Documentation ¶
Index ¶
- Variables
- type CredentialsValidator
- type Service
- func (s *Service) GetExistingSession(ctx context.Context, token domain.SessionToken) (domain.Session, error)
- func (s *Service) Login(ctx context.Context, phone string, password string) (domain.Session, error)
- func (s *Service) Logout(ctx context.Context, token domain.SessionToken) error
- func (s *Service) RenewSession(ctx context.Context, token domain.SessionToken) (domain.Session, error)
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCredentialsValidatorNotFound = errors.New("credentials validator error: account not found") ErrCredentialsValidatorInvalid = errors.New("credentials validator error: invalid input") )
View Source
var ( ErrCredentialsAreInvalid = errors.New("credentials are invalid") ErrSessionAlreadyExists = errors.New("session already exists") ErrSessionDoesNotExist = errors.New("session does not exist") ErrInternal = errors.New("internal error occurred") )
View Source
var ( ErrStorageNotFound = errors.New("session is not found in the storage") ErrStorageAlreadyExists = errors.New("session already exists in the storage") )
Functions ¶
This section is empty.
Types ¶
type CredentialsValidator ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) GetExistingSession ¶
func (*Service) RenewSession ¶
type Storage ¶
type Storage interface { GetByID(ctx context.Context, id uuid.UUID) (domain.Session, error) GetByToken(ctx context.Context, token domain.SessionToken) (domain.Session, error) Add(ctx context.Context, session domain.Session) error RemoveByID(ctx context.Context, id uuid.UUID) (domain.Session, error) RemoveByToken(ctx context.Context, token domain.SessionToken) (domain.Session, error) }
Click to show internal directories.
Click to hide internal directories.