Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidRegistrationConfig = errors.New("services: invalid registration configuration")
Functions ¶
This section is empty.
Types ¶
type AccessApplication ¶
type AccessApplication struct {
// contains filtered or unexported fields
}
AccessApplication holds all services related to access management.
func NewAccessApplication ¶
func NewAccessApplication(cfgs []AccessConfig) (*AccessApplication, error)
NewAccessApplication intitializes the access application.
func (*AccessApplication) CheckPasswordHash ¶
func (a *AccessApplication) CheckPasswordHash(password, hash string) bool
CheckPasswordHash checks that the input password matches the hash.
func (*AccessApplication) HashPassword ¶
func (a *AccessApplication) HashPassword(password string) (string, error)
HashPassword hashes a password from plain text.
func (*AccessApplication) RegisterUser ¶
func (a *AccessApplication) RegisterUser(name, email, password string) (UserDTO, error)
RegisterUser registers a user if the email is not already registered.
type AccessConfig ¶
type AccessConfig func(a *AccessApplication) error
AccessConfig is a function that modifies the application configuration.
func WithMemoryRepositories ¶
func WithMemoryRepositories() AccessConfig
WithMemoryRepositories attaches in-memory repostories to application.
func WithPasswordHashCost ¶
func WithPasswordHashCost(cost int) AccessConfig
WithPasswordHashCost attaches a password hash cost to application.
Click to show internal directories.
Click to hide internal directories.