Documentation
¶
Index ¶
- Variables
- type DirectoryKeyEnvelope
- type ID
- type Profile
- type Repository
- type Service
- func (s *Service) Count(ctx context.Context) (int, error)
- func (s *Service) Create(ctx context.Context, username string) (User, error)
- func (s *Service) CreateWithPassword(ctx context.Context, username, passwordHash string) (User, error)
- func (s *Service) CreateWithPasswordAndID(ctx context.Context, id ID, username, passwordHash string, isAdmin bool, ...) (User, error)
- func (s *Service) GetByID(ctx context.Context, id ID) (User, error)
- func (s *Service) GetByUsername(ctx context.Context, username string) (User, error)
- func (s *Service) GetDirectoryKeyEnvelope(ctx context.Context, deviceID string) (DirectoryKeyEnvelope, error)
- func (s *Service) ListProfiles(ctx context.Context) ([]Profile, error)
- func (s *Service) NewID() ID
- func (s *Service) UpsertDirectoryKeyEnvelope(ctx context.Context, env DirectoryKeyEnvelope) error
- func (s *Service) UpsertProfile(ctx context.Context, userID ID, nameEnc string) error
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidInput = errors.New("invalid input")
Functions ¶
This section is empty.
Types ¶
type DirectoryKeyEnvelope ¶
type Repository ¶
type Repository interface {
Create(ctx context.Context, user User) error
GetByID(ctx context.Context, id ID) (User, error)
GetByUsernameHash(ctx context.Context, usernameHash string) (User, error)
Count(ctx context.Context) (int, error)
UpsertProfile(ctx context.Context, profile Profile) error
ListProfiles(ctx context.Context) ([]Profile, error)
UpsertDirectoryKeyEnvelope(ctx context.Context, env DirectoryKeyEnvelope) error
GetDirectoryKeyEnvelope(ctx context.Context, deviceID string) (DirectoryKeyEnvelope, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo Repository, pepper string) *Service
func (*Service) CreateWithPassword ¶
func (*Service) CreateWithPasswordAndID ¶
func (*Service) GetByUsername ¶
func (*Service) GetDirectoryKeyEnvelope ¶
func (*Service) ListProfiles ¶
func (*Service) UpsertDirectoryKeyEnvelope ¶
func (s *Service) UpsertDirectoryKeyEnvelope(ctx context.Context, env DirectoryKeyEnvelope) error
Click to show internal directories.
Click to hide internal directories.