Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code struct { gorm.Model Id int `json:"-" gorm:"primaryKey;unique;autoIncrement"` Code string `json:"code"` UserId int `json:"-"` User User `json:"-" gorm:"foreignKey:UserId"` Action KindCode `json:"-"` Data string `json:"-"` IsUsed bool `json:"-"` ExpireAt time.Time `json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
type CodeRepository ¶
type CodeRepository interface { GetById(Id int) (*Code, error) GetByCode(value string) (*Code, error) GetLastIsActiveCode(UserId int, Action string) (*Code, error) Create(code *Code) error Update(code *Code) error UpdateWithAssociations(code *Code) error ExtendExpiration(code *Code) error Delete(code *Code) error }
type User ¶
type User struct { Id int `json:"-" gorm:"primaryKey;unique;autoIncrement"` Uuid uuid.UUID `json:"uuid" gorm:"unique"` Email string `json:"email" gorm:"unique"` PasswordHash string `json:"-"` Role KindRole `json:"role"` IsActive bool `json:"-"` GoogleId string `json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
type UserRepository ¶
type UserRepository interface { GetById(Id int) (*User, error) GetByUserId(UserId int) (*User, error) GetByUuid(Uuid uuid.UUID) (*User, error) GetByEmail(Email string) (*User, error) GetByGoogleId(GoogleId string) (*User, error) Create(user *User) error Update(user *User) error Delete(user *User) error }
Click to show internal directories.
Click to hide internal directories.