Documentation ¶
Index ¶
- type User
- func (u *User) BeforeSave() error
- func (u *User) DeleteUser(db *gorm.DB, id string) (int64, error)
- func (u *User) FindAllUsers(db *gorm.DB) (*[]User, error)
- func (u *User) FindUserByID(db *gorm.DB, id string) (*User, error)
- func (u *User) Prepare()
- func (u *User) SaveUser(db *gorm.DB) (*User, error)
- func (u *User) UpdateUser(db *gorm.DB, id string) (*User, error)
- func (u *User) Validate(action string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { UserID string `json:"user_id" gorm:"primary_key;auto_increment"` UserName string `json:"username" gorm:"size:255;not null;unique"` Email string `json:"email" gorm:"size:100;not null;unique"` Password string `json:"password" gorm:"size:100;not null;"` CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP"` UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP"` }
func (*User) BeforeSave ¶
Click to show internal directories.
Click to hide internal directories.