Documentation ¶
Index ¶
- type UserService
- func (s UserService) AddRoles(ctx context.Context, roles []string, id uuid.UUID) error
- func (s UserService) ChangePassword(ctx context.Context, req *user.ChangePasswordRequest) error
- func (s UserService) ConfirmEmail(ctx context.Context, req user.ConfirmEmailRequest) error
- func (s UserService) Create(ctx context.Context, req *user.CreateRequest) (*user.CreateResponse, error)
- func (s UserService) DeleteById(ctx context.Context, id uuid.UUID) error
- func (s UserService) EnableDisable(ctx context.Context, id uuid.UUID) error
- func (s UserService) GetById(ctx context.Context, id uuid.UUID) (*user.Dto, error)
- func (s UserService) GetPage(ctx context.Context, pagabale domain.Pageable) (*domain.Page[user.Dto], error)
- func (s UserService) RemoveRoles(ctx context.Context, roles []string, id uuid.UUID) error
- func (s UserService) SingIn(ctx context.Context, req *user.SignInRequest) (*user.SignInResponse, error)
- func (s UserService) SingUp(ctx context.Context, req *user.CreateRequest) (*user.SignUpResponse, error)
- func (s UserService) Update(ctx context.Context, req *user.UpdateRequest) (*user.UpdateResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService.
func NewUserService ¶
func NewUserService(userRepo ports.UserRepo[uuid.UUID], authConfig configs.AuthConfig) UserService
NewUserService instantiate new UserService.
func (UserService) ChangePassword ¶
func (s UserService) ChangePassword(ctx context.Context, req *user.ChangePasswordRequest) error
ChangePassword updates user password.
func (UserService) ConfirmEmail ¶
func (s UserService) ConfirmEmail(ctx context.Context, req user.ConfirmEmailRequest) error
ConfirmEmail enables user when user confirs it's email address.
func (UserService) Create ¶
func (s UserService) Create(ctx context.Context, req *user.CreateRequest) (*user.CreateResponse, error)
Create creates new user. This function is for admin user only. Returns newly created user.
func (UserService) DeleteById ¶
DeleteById deletes existing user.
func (UserService) EnableDisable ¶
EnableDisable is for admin usage only, to enable user if disabled and vice versa.
func (UserService) GetPage ¶
func (s UserService) GetPage(ctx context.Context, pagabale domain.Pageable) (*domain.Page[user.Dto], error)
GetPage returns page of users.
func (UserService) RemoveRoles ¶
AddRoles appends user roles.
func (UserService) SingIn ¶
func (s UserService) SingIn(ctx context.Context, req *user.SignInRequest) (*user.SignInResponse, error)
SingIn authenticates user. Returns new signed jwt token.
func (UserService) SingUp ¶
func (s UserService) SingUp(ctx context.Context, req *user.CreateRequest) (*user.SignUpResponse, error)
SingUp register new user.
func (UserService) Update ¶
func (s UserService) Update(ctx context.Context, req *user.UpdateRequest) (*user.UpdateResponse, error)
Update updates existing user. Returns user with fresh changes.
Click to show internal directories.
Click to hide internal directories.