Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PandaFile ¶
type PandaFile struct { ID string `gorm:"type:uuid;primary_key:true"` FileName string `gorm:"size:255"` FileType string `gorm:"size:30"` FileSize int64 FileURL string `gorm:"size:255"` Tags []*Tag `gorm:"many2many:panda_tags;association_foreignkey:tag"` UploaderEmail string `gorm:"index;not null"` Uploader *User `gorm:"foreignkey:UserEmail"` CreatedAt time.Time `gorm:"index"` UpdatedAt time.Time DeletedAt *time.Time }
PandaFile represents an uploaded file that has a panda in it
type Tag ¶
type Tag struct { Tag string `gorm:"size:255;primary_key:true"` Files []*PandaFile `gorm:"many2many:panda_tags;foreignkey:tag"` CreatedAt time.Time }
Tag is a simple string attached to a file
type User ¶
type User struct { Email string `gorm:"size:255;primary_key:true"` Password string `gorm:"-"` EncryptedPassword []byte `gorm:"size:255" json:"-"` CreatedAt time.Time `gorm:"index"` UpdatedAt time.Time DeletedAt *time.Time }
User is logged in user
func (*User) BeforeSave ¶
BeforeSave encrypts the User's password before saving it
func (*User) ValidatePassword ¶
ValidatePassword will return true if the password param is correct
Click to show internal directories.
Click to hide internal directories.