attachments

package
v0.0.0-...-6dfde0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

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)

func NewImage

func NewImage(userID, postID string, f multipart.File) (Attachment, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL