services

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorLoginNotAllowed   = &ServiceError{"msg.error.login"}
	ErrorUserNotCreated    = &ServiceError{"msg.error.user.create"}
	ErrorUserNotSaved      = &ServiceError{"msg.error.user.update"}
	ErrorUserNotDeleted    = &ServiceError{"msg.error.user.delete"}
	ErrorUserPasswordRules = &ServiceError{"msg.error.user.passwordrules"}
)

Functions

This section is empty.

Types

type ServiceError

type ServiceError struct {
	// contains filtered or unexported fields
}

ServiceError ...

func (*ServiceError) Error

func (se *ServiceError) Error() string

ServiceError implements error

type Services

type Services struct {
	DS data.Datastore
	EF entitymodel.EntityFactory
}

Services the business services

func NewServices

func NewServices(ef entitymodel.EntityFactory, ds data.Datastore) *Services

NewServices ...

func (Services) CreateUser

func (s Services) CreateUser(username string, pass string, email string, role types.RoleType) (*models.User, error)

CreateUser create new user

func (Services) Do

func (s Services) Do(par1 int, par2 int) (int, error)

Do ... just for test mocking

func (Services) GetEntityOptions

func (s Services) GetEntityOptions(entityType genmodels.EntityType) ([]entitydto.EntityOption, error)

GetEntityOptions ...

func (Services) LoginUser

func (s Services) LoginUser(username string, pass string) (*models.User, error)

LoginUser check user and pwd

func (Services) UpdateUser

func (s Services) UpdateUser(username string, email string, role types.RoleType) (*models.User, error)

UpdateUser update user data

Jump to

Keyboard shortcuts

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