Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidArgs = errors.New("Invalid Args") ErrKeyConflict = errors.New("Key Conflict") ErrDataNotFound = errors.New("Record Not Found") ErrUserExists = errors.New("User already exists") ErrUnknown = errors.New("Unknown Error") ErrFailed = errors.New("Failed") )
Model errors
Functions ¶
Types ¶
type DBInstance ¶
type DBInstance struct {
// contains filtered or unexported fields
}
DBInstance is a singleton DB instance
func (*DBInstance) Instance ¶
func (i *DBInstance) Instance() any
Instance gets the singleton instance
type User ¶
type User struct { ID uint `gorm:"primary_key" json:"id"` Name string `json:"name"` Email string `json:"email"` Password string `json:"-"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
User the user model
func LoginByEmailAndPassword ¶
LoginByEmailAndPassword login a user by his email and password
func (*User) GetFirstByEmail ¶
GetFirstByEmail gets the user by his email
func (*User) GetFirstByID ¶
GetFirstByID gets the user by his ID
Click to show internal directories.
Click to hide internal directories.