Documentation ¶
Index ¶
- Variables
- type JWTAuthService
- type UserService
- func (s *UserService) CreateUser(user models.User) error
- func (s *UserService) DeleteUser(id uint) error
- func (s *UserService) GetAllUser() (users []models.User, err error)
- func (s *UserService) GetOneUser(id uint) (user models.User, err error)
- func (s *UserService) UpdateUser(user models.User) error
- func (s *UserService) WithTx(txHandle *gorm.DB) *UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewUserService), fx.Provide(NewJWTAuthService), )
Module exports services present
Functions ¶
This section is empty.
Types ¶
type JWTAuthService ¶
type JWTAuthService struct {
// contains filtered or unexported fields
}
JWTAuthService service relating to authorization
func NewJWTAuthService ¶
func NewJWTAuthService(cfg *config.Config) *JWTAuthService
NewJWTAuthService creates a new auth service
func (*JWTAuthService) Authorize ¶
func (s *JWTAuthService) Authorize(tokenString string) (bool, error)
Authorize authorizes the generated token
func (*JWTAuthService) CreateToken ¶
func (s *JWTAuthService) CreateToken(user models.User) string
CreateToken creates jwt auth token
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService service layer
func NewUserService ¶
func NewUserService(repository *repo.UserRepository) *UserService
NewUserService creates a new userservice
func (*UserService) CreateUser ¶
func (s *UserService) CreateUser(user models.User) error
CreateUser call to create the user
func (*UserService) DeleteUser ¶
func (s *UserService) DeleteUser(id uint) error
DeleteUser deletes the user
func (*UserService) GetAllUser ¶
func (s *UserService) GetAllUser() (users []models.User, err error)
GetAllUser get all the user
func (*UserService) GetOneUser ¶
func (s *UserService) GetOneUser(id uint) (user models.User, err error)
GetOneUser gets one user
func (*UserService) UpdateUser ¶
func (s *UserService) UpdateUser(user models.User) error
UpdateUser updates the user
func (*UserService) WithTx ¶
func (s *UserService) WithTx(txHandle *gorm.DB) *UserService
WithTx delegates transaction to repository database
Click to show internal directories.
Click to hide internal directories.