Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotExists user not exists ErrNotExists = errors.New("User doesn't exist") // ErrWrongCredentials wrong credentials provided ErrWrongCredentials = errors.New("Wrong credentials") ErrUnauthorized = errors.New("Not authorized") // ErrTokenExpired - token expired ErrTokenExpired = errors.New("Token expired") // ErrUserAlreadyExists user with the same name already exists ErrUserAlreadyExists = errors.New("User exists") )
Functions ¶
This section is empty.
Types ¶
type UserInteractor ¶
type UserInteractor interface { Authenticate(username, password, remoteAddr string) (*entities.User, *entities.Session, error) Authorize(string) (*entities.User, error) Create(*entities.User) error }
UserInteractor combines different implementations to process external requests.
func NewUserInteractor ¶
func NewUserInteractor( config config.AppConfig, userRepository implementation.UserRepository, sessionRepository implementation.SessionRepository, ) (UserInteractor, error)
NewUserInteractor constructs UserInteractor.
type UserInteractorImpl ¶
type UserInteractorImpl struct {
// contains filtered or unexported fields
}
UserInteractorImpl implements UserInteractor.
func (UserInteractorImpl) Authenticate ¶
func (userInteractor UserInteractorImpl) Authenticate(username, password, remoteAddr string) (*entities.User, *entities.Session, error)
Authenticate generates access token.
Click to show internal directories.
Click to hide internal directories.