Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TNone - zero value TNone int = iota // TLink - An external link TLink // TImage - a still image TImage // TGif - a .gif image TGif // TVideo - an external video TVideo )
Attachment types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct { ID string `json:"id" gorm:"primary_key" sql:"type:uuid;default:uuid_generate_v4()"` UserID string `json:"user_id" sql:"type:uuid"` PostID string `json:"post_id" sql:"type:uuid"` Type int `json:"type"` URL string `json:"url" sql:"not_null"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func GetByPostID ¶
func GetByPostID(postID string, db *gorm.DB) (as []Attachment, err error)
func GetByPostIDs ¶
func GetByPostIDs(postIDs []string, db *gorm.DB) (as []Attachment, err error)
Click to show internal directories.
Click to hide internal directories.