service

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorsMapper

type ErrorsMapper struct{}

func NewErrorsMapper added in v1.1.0

func NewErrorsMapper() ErrorsMapper

func (ErrorsMapper) Map

func (e ErrorsMapper) Map(err error) error

type Service

type Service struct {
	Config       config.ConfigI
	Auth         auth.AuthI
	Codec        codec.CodecI
	Repository   repository.RepositoryLayer
	ErrorsMapper errorsMapperI
}

func NewService

func NewService(repository repository.RepositoryLayer, auth auth.AuthI, codec codec.CodecI, config config.ConfigI, errorsMapper errorsMapperI) *Service

func (*Service) CreateUser added in v1.1.0

func (s *Service) CreateUser(createUserRequest entities.CreateUserRequest) (entities.CreateUserResponse, error)

CreateUser is an admins only endpoint

func (*Service) DeleteUser

func (s *Service) DeleteUser(deleteUserRequest entities.DeleteUserRequest) (entities.DeleteUserResponse, error)

func (*Service) GetUser

func (s *Service) GetUser(getUserRequest entities.GetUserRequest) (entities.GetUserResponse, error)

func (*Service) Login

func (s *Service) Login(loginRequest entities.LoginRequest) (entities.LoginResponse, error)

func (*Service) Signup

func (s *Service) Signup(signupRequest entities.SignupRequest) (entities.SignupResponse, error)

func (*Service) UpdateUser

func (s *Service) UpdateUser(updateUserRequest entities.UpdateUserRequest) (entities.UpdateUserResponse, error)

type ServiceLayer added in v1.2.0

type ServiceLayer interface {
	Signup(signupRequest entities.SignupRequest) (entities.SignupResponse, error)
	Login(loginRequest entities.LoginRequest) (entities.LoginResponse, error)

	CreateUser(createUserRequest entities.CreateUserRequest) (entities.CreateUserResponse, error)
	GetUser(getUserRequest entities.GetUserRequest) (entities.GetUserResponse, error)
	UpdateUser(updateUserRequest entities.UpdateUserRequest) (entities.UpdateUserResponse, error)
	DeleteUser(deleteUserRequest entities.DeleteUserRequest) (entities.DeleteUserResponse, error)
}

Jump to

Keyboard shortcuts

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