Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code struct { ID int `json:"id" gorm:"primaryKey;unique;autoIncrement"` Code int `json:"code"` UserID int `json:"userId"` User User `json:"user" gorm:"foreignKey:UserID"` // Relation to User [Belongs To Association] CreatedAt time.Time `json:"createdAt"` ExpireAt time.Time `json:"expireAt"` Action string `json:"action"` Data string `json:"data"` IsUsed bool `json:"isUsed"` }
type CodeRepository ¶
type CodeRepository interface { FindAll() (*[]Code, error) FindByID(ID int) (*Code, error) Create(code *Code) error Update(code *Code) error UpdateWithAssociations(code *Code) error Delete(code *Code) error GetByCode(Code int) (*Code, error) GetLastIsActiveCode(UserID int, Action string) (*Code, error) ExtendExpiration(code *Code) error NewCode(User User, Action string, Data string) (*Code, error) }
type User ¶
type User struct { ID int `json:"id" gorm:"primaryKey;unique;autoIncrement"` Email string `json:"email" gorm:"unique"` Password string `json:"-"` Role string `json:"role"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` IsActive bool `json:"isActive"` GoogleID string `json:"googleId"` }
type UserRepository ¶
type UserRepository interface { FindAll() (*[]User, error) FindByID(ID int) (*User, error) FindByEmail(Email string) (*User, error) FindByGoogleID(GoogleID string) (*User, error) Create(user *User) error Update(user *User) error Delete(user *User) error ResetPassword(user *User, password string) error PasswordMatches(user *User, plainText string) (bool, error) }
Click to show internal directories.
Click to hide internal directories.