Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseModel ¶
type BaseModel struct { ID string `json:"id" gorm:"PRIMARY_KEY"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at" sql:"index"` }
BaseModel is a model definition, including fields `ID` as UUID, `CreatedAt`, `UpdatedAt`, and `DeletedAt`, which could be embedded in your models.
USAGE:
type User struct { database.BaseModel Email string `json:"email" gorm:"UNIQUE;NOT NULL"` Password string `json:"password" gorm:"NOT NULL"` }
Click to show internal directories.
Click to hide internal directories.