Documentation ¶
Index ¶
- type AuthenticationClaims
- type AuthenticationService
- type IAuthenticationService
- type ILoginService
- type IUserService
- type LoginService
- type UserService
- func (u *UserService) CreateUser(user *models.User) (*models.User, error)
- func (u *UserService) DeleteUser(id *int) error
- func (u *UserService) GetAllUsers() *[]models.User
- func (u *UserService) GetUser(id *int) (*models.User, error)
- func (u *UserService) UpdateUser(id *int, user *models.User) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationClaims ¶
type AuthenticationClaims struct { jwt.StandardClaims // contains filtered or unexported fields }
type AuthenticationService ¶
type AuthenticationService struct {
// contains filtered or unexported fields
}
func (*AuthenticationService) SignToken ¶
func (a *AuthenticationService) SignToken(email string, isUser bool) string
func (*AuthenticationService) ValidateToken ¶
func (a *AuthenticationService) ValidateToken(token string) (*jwt.Token, error)
type IAuthenticationService ¶
type IAuthenticationService interface { SignToken(email string, isUser bool) string ValidateToken(token string) (*jwt.Token, error) }
func NewAuthenticationService ¶
func NewAuthenticationService() IAuthenticationService
type ILoginService ¶
func NewLoginService ¶
func NewLoginService(ctx context.Context, authenticationService IAuthenticationService) ILoginService
type IUserService ¶
type IUserService interface { CreateUser(*models.User) (*models.User, error) GetUser(*int) (*models.User, error) GetAllUsers() *[]models.User UpdateUser(*int, *models.User) (*models.User, error) DeleteUser(*int) error }
func NewUserService ¶
func NewUserService(userDb *gorm.DB, ctx context.Context) IUserService
type LoginService ¶
type LoginService struct { AuthenticationService IAuthenticationService // contains filtered or unexported fields }
func (*LoginService) AdminLogin ¶
func (l *LoginService) AdminLogin(email, password string) string
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func (*UserService) CreateUser ¶
func (*UserService) DeleteUser ¶
func (u *UserService) DeleteUser(id *int) error
func (*UserService) GetAllUsers ¶
func (u *UserService) GetAllUsers() *[]models.User
func (*UserService) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.