Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Create(user *User) (*User, error) GetByID(id uint) (*User, error) GetByEmail(email string) (*User, error) GetAll() ([]*User, error) Update(user *User) (*User, error) Delete(user *User) error }
Repository represents the user permanent repo
type Usecase ¶
type Usecase interface { Repository Login(email, password string) (*User, error) ChangePassword(id uint, oldPassword, newPassword string) (*User, error) }
Usecase represents users usecases Extends User entity interface
func NewUsecase ¶
func NewUsecase(repo Repository, passSvc pass.Service) Usecase
NewUsecase creates a new usecase. Implements the Usecase interface
type User ¶
type User struct { ID uint `gorm:"primaryKey"` Surname string `gorm:"size:60" validate:"required,gte=2,lte=60"` Name string `gorm:"size:60" validate:"lte=60"` Email string `gorm:"size=60,unique" validate:"email,required"` Password string `gorm:"-"` Hash string `gorm:"size=60"` IsActive bool }
User describes a user in the system
Click to show internal directories.
Click to hide internal directories.