Documentation
¶
Index ¶
- func Hash(password string) ([]byte, error)
- func VerifyPassword(hashedPassword, password string) error
- type User
- func (u *User) BeforeSave() error
- func (u *User) DeleteUser(db *gorm.DB, uid uint32) (int64, error)
- func (u *User) FindAllUsers(db *gorm.DB) (*[]User, error)
- func (u *User) FindUserByID(db *gorm.DB, uid uint32) (*User, error)
- func (u *User) Prepare()
- func (u *User) SaveUser(db *gorm.DB) (*User, error)
- func (u *User) UpdateUser(db *gorm.DB, uid uint32) (*User, error)
- func (u *User) Validate(action string) error
- type Wine
- func (w *Wine) DeleteWine(db *gorm.DB, pid uint64) (int64, error)
- func (w *Wine) FindAllWines(db *gorm.DB) (*[]Wine, error)
- func (w *Wine) FindWineByID(db *gorm.DB, pid uint64) (*Wine, error)
- func (w *Wine) Prepare()
- func (w *Wine) SaveWine(db *gorm.DB) (*Wine, error)
- func (w *Wine) UpdateWine(db *gorm.DB) (*Wine, error)
- func (w *Wine) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyPassword ¶
Types ¶
type User ¶
type User struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:200;not null;unique" json:"name"` Email string `gorm:"size:200;not null;unique" json:"email"` Password string `gorm:"size:200;not null;" json:"password"` Admin bool `gorm:"type:bool;default:false;" json:"admin"` }
func (*User) BeforeSave ¶
type Wine ¶
type Wine struct { ID uint64 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:200;not null;unique" json:"title"` Description string `gorm:"size:200;not null;" json:"content"` Year string `gorm:"size:200;not null;" json:"year"` Price string `gorm:"size:200;not null;" json:"price"` Image string `gorm:"size:200;not null;" json:"image"` Available bool `gorm:"type:bool;default:false" json:"available"` }
Click to show internal directories.
Click to hide internal directories.