Documentation
¶
Index ¶
- func ExtractObjectKeyFromRequest(dto any) (string, error)
- type AcceptFriendRequest
- type AvatarResetResponse
- type ChangePasswordRequest
- type CreateCommentRequest
- type CreateProjectRequest
- type CreateTrackRequest
- type GenreSummary
- type GetPrivateTrackUploadUrl
- type HasObjectKey
- type IDMessageResponse
- type LoginRequest
- type MaxPagesResponse
- type MinioUploadEvent
- type PagingQuery
- type RatingResponse
- type RefuseFriendRequest
- type RemoveFriendRequest
- type ResetPasswordRequest
- type SendFriendRequest
- type SignUpRequest
- type UpdateCommentRequest
- type UpdateProjectRequest
- type UpdateTrackRequest
- type UpdateUserRequest
- type UploadAvatarURLRequest
- type UploadFile
- type UpsertRatingRequest
- type UserSummary
- type WithRequestID
- type WithdrawFriendRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AcceptFriendRequest ¶
type AcceptFriendRequest struct {
WithRequestID
}
type AvatarResetResponse ¶
type ChangePasswordRequest ¶
type ChangePasswordRequest struct {
NewPassword string `json:"new_password" binding:"required,min=6"`
}
type CreateCommentRequest ¶
type CreateCommentRequest struct {
Content string `json:"content" binding:"required,max=3000"`
TrackID string `json:"track_id" binding:"required,uuid"`
AuthorID string `json:"author_id" binding:"required,uuid"`
ReplyToID *string `json:"reply_to_id" binding:"omitempty,uuid"` // Optional pointer
}
1. INPUT (Create)
type CreateProjectRequest ¶
type CreateProjectRequest struct {
Name string `json:"name" binding:"required,min=1,max=100"`
Description string `json:"description" binding:"omitempty,max=500"`
}
1. INPUT (Create Project)
type CreateTrackRequest ¶
type CreateTrackRequest struct {
HasObjectKey
Name string `json:"name" binding:"required,min=1,max=100"`
GenreID string `json:"genre_id" binding:"required,uuid"`
IsPublic bool `json:"is_public"`
ObjectKey string `json:"object_key" binding:"required"`
}
CreateTrackRequest is used for validating input when uploading a new track.
func (CreateTrackRequest) GetObjectKey ¶
func (req CreateTrackRequest) GetObjectKey() string
type GenreSummary ¶
GenreSummary is used when embedding a genre inside a Track response
type GetPrivateTrackUploadUrl ¶
type GetPrivateTrackUploadUrl struct {
AudioFile string `json:"audio_file" binding:"omitempty"`
}
type HasObjectKey ¶
type HasObjectKey interface {
GetObjectKey() string
}
type IDMessageResponse ¶
type LoginRequest ¶
type MaxPagesResponse ¶
type MinioUploadEvent ¶
type MinioUploadEvent struct {
Records []struct {
S3 struct {
Bucket struct {
Name string `json:"name"` // maps to "name" in JSON
} `json:"bucket"`
Object struct {
Key string `json:"key"` // maps to "key" in JSON
} `json:"object"`
} `json:"s3"`
} `json:"Records"`
}
TrackResponse represents the public-facing data for a music track. Using DTOs prevents sensitive internal model fields from being exposed.
type PagingQuery ¶
type RatingResponse ¶
type RefuseFriendRequest ¶
type RefuseFriendRequest struct {
WithRequestID
}
type RemoveFriendRequest ¶
type ResetPasswordRequest ¶
type ResetPasswordRequest struct {
Email string `json:"email" binding:"required,email"`
}
type SendFriendRequest ¶
type SignUpRequest ¶
type UpdateCommentRequest ¶
type UpdateCommentRequest struct {
Content string `json:"content" binding:"required,max=3000"`
}
2. INPUT (Update)
type UpdateProjectRequest ¶
type UpdateProjectRequest struct {
Name string `json:"name" binding:"omitempty,min=1,max=100"`
Description string `json:"description" binding:"omitempty,max=500"`
Visibility string `json:"visibility" binding:"omitempty,oneof=public private friends"`
JSONProject json.RawMessage `json:"json_project" binding:"omitempty" swaggertype:"object"`
}
2. INPUT (Update an existing Project)
type UpdateTrackRequest ¶
type UpdateTrackRequest struct {
HasObjectKey
Name string `json:"name" binding:"omitempty,min=1,max=100"`
ObjectKey string `json:"object_key" binding:"omitempty"`
}
func (UpdateTrackRequest) GetObjectKey ¶
func (req UpdateTrackRequest) GetObjectKey() string
type UpdateUserRequest ¶
type UploadAvatarURLRequest ¶
type UploadFile ¶
type UpsertRatingRequest ¶
type UpsertRatingRequest struct {
Value int `json:"value" binding:"required,min=1,max=10"`
TrackID string `json:"track_id" binding:"required,uuid"`
AuthorID string `json:"author_id" binding:"required,uuid"`
}
1. INPUT (Upsert) We only need the value, track, and author.
type UserSummary ¶
type UserSummary struct {
ID uuid.UUID `json:"id"`
Username string `json:"username"`
Avatar string `json:"avatar"`
}
UserSummary is used in Tracks, Comments, and Ratings to show the author without revealing sensitive data like email or password.
type WithRequestID ¶
type WithdrawFriendRequest ¶
Click to show internal directories.
Click to hide internal directories.