services

package
v0.0.0-...-caa70b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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) AddRoles

func (s UserService) AddRoles(ctx context.Context, roles []string, id uuid.UUID) error

AddRoles appends user roles.

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

Create creates new user. This function is for admin user only. Returns newly created user.

func (UserService) DeleteById

func (s UserService) DeleteById(ctx context.Context, id uuid.UUID) error

DeleteById deletes existing user.

func (UserService) EnableDisable

func (s UserService) EnableDisable(ctx context.Context, id uuid.UUID) error

EnableDisable is for admin usage only, to enable user if disabled and vice versa.

func (UserService) GetById

func (s UserService) GetById(ctx context.Context, id uuid.UUID) (*user.Dto, error)

GetById returns existing user.

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

func (s UserService) RemoveRoles(ctx context.Context, roles []string, id uuid.UUID) error

AddRoles appends user roles.

func (UserService) SingIn

SingIn authenticates user. Returns new signed jwt token.

func (UserService) SingUp

SingUp register new user.

func (UserService) Update

Update updates existing user. Returns user with fresh changes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL