Documentation
¶
Index ¶
- Variables
- type CreateUserParams
- type Invite
- type RegisterParams
- type Repository
- type Service
- func (s *Service) CreateInvite(ctx context.Context, inviterID, email string) (Invite, string, error)
- func (s *Service) Login(ctx context.Context, email, password string) (User, Session, error)
- func (s *Service) Logout(ctx context.Context, rawToken string) error
- func (s *Service) Register(ctx context.Context, params RegisterParams) (User, error)
- func (s *Service) RegistrationOpen(ctx context.Context) (bool, error)
- func (s *Service) StartSession(ctx context.Context, userID string) (Session, error)
- func (s *Service) UserBySession(ctx context.Context, rawToken string) (User, error)
- func (s *Service) ValidateInvite(ctx context.Context, rawToken string) (Invite, error)
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrConflict = errors.New("conflict") ErrBootstrapClosed = errors.New("first-account registration is closed") ErrInvalidInvite = errors.New("invalid or expired invitation") ErrPermissionDenied = errors.New("permission denied") ErrInvalidCredentials = errors.New("invalid email or password") )
Functions ¶
This section is empty.
Types ¶
type CreateUserParams ¶
type RegisterParams ¶
type Repository ¶
type Repository interface {
HasUsers(context.Context) (bool, error)
BootstrapOwner(context.Context, CreateUserParams) (User, error)
RegisterWithInvite(context.Context, []byte, CreateUserParams) (User, error)
InviteByToken(context.Context, []byte, time.Time) (Invite, error)
CreateFamilyInvite(context.Context, string, string, []byte, time.Time) (Invite, error)
UserByEmail(context.Context, string) (User, error)
CreateSession(context.Context, []byte, string, time.Time) error
UserBySession(context.Context, []byte, time.Time) (User, error)
DeleteSession(context.Context, []byte) error
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository, sessionTTL time.Duration) (*Service, error)
func (*Service) CreateInvite ¶
func (*Service) RegistrationOpen ¶
func (*Service) StartSession ¶
func (*Service) UserBySession ¶
Click to show internal directories.
Click to hide internal directories.