services

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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