models

package
v0.0.0-...-75e0a89 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	ID          uint           `gorm:"primarykey" json:"id"`
	ContentType ContentType    `gorm:"column:content_type;type:varchar(8)" json:"content_type"`
	Size        uint           `json:"size"`
	Duration    sql.NullString `gorm:"column:duration;type:varchar(10)" json:"duration"`
	FileURL     string         `gorm:"column:file_url;type:varchar(500)" json:"file_url"`
	CreatedAt   time.Time      `json:"created_at"`
	UpdatedAt   time.Time      `json:"updated_at"`
}

type ContentType

type ContentType string
const (
	Image ContentType = "IMAGE"
	Video ContentType = "VIDEO"
	Audio ContentType = "AUDIO"
)

type Follow

type Follow struct {
	ID         uint      `gorm:"primarykey" json:"id"`
	CreatedAt  time.Time `json:"created_at"`
	LeaderID   uint      `json:"leader_id" gorm:"index:idx_leader_follower,unique"`
	FollowerID uint      `json:"follower_id" gorm:"index:idx_leader_follower,unique"`
}

type Post

type Post struct {
	ID        uint      `gorm:"primarykey" json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type User

type User struct {
	ID        uint      `gorm:"primarykey" json:"id"`
	Username  string    `gorm:"column:username;type:varchar(255);uniqueIndex" json:"username"`
	Password  string    `gorm:"column:password;type:varchar(255)" json:"-"`
	Email     string    `gorm:"column:email;type:varchar(255)" json:"-"`
	LastLogin time.Time `json:"last_login"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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