Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a user was not found. ErrNotFound = errors.New("user not found") // ErrAlreadyAssigned is returned when a user is already assigned. ErrAlreadyAssigned = errors.New("user is already assigned") // ErrNotAssigned is returned when a user is not assigned. ErrNotAssigned = errors.New("user is not assigned") // ErrWrongAuth is returned when providing wrong credentials. ErrWrongAuth = errors.New("wrong username or password") )
Functions ¶
This section is empty.
Types ¶
type LoggingRequestID ¶
LoggingRequestID returns the request ID as string for logging
type Service ¶
type Service interface {
ByBasicAuth(context.Context, string, string) (*model.User, error)
List(context.Context) ([]*model.User, error)
Show(context.Context, string) (*model.User, error)
Create(context.Context, *model.User) (*model.User, error)
Update(context.Context, *model.User) (*model.User, error)
Delete(context.Context, string) error
ListTeams(context.Context, string) ([]*model.TeamUser, error)
AppendTeam(context.Context, string, string, string) error
PermitTeam(context.Context, string, string, string) error
DropTeam(context.Context, string, string) error
}
Service handles all interactions with users.
func NewLoggingService ¶
func NewLoggingService(s Service, requestID LoggingRequestID) Service
NewLoggingService wraps the Service and provides logging for its methods.
func NewService ¶
NewService returns a Service that handles all interactions with users.
func NewTracingService ¶
func NewTracingService(s Service, requestID TracingRequestID) Service
NewTracingService wraps the Service and provides tracing for its methods.
type Store ¶
type Store interface {
ByBasicAuth(context.Context, string, string) (*model.User, error)
List(context.Context) ([]*model.User, error)
Show(context.Context, string) (*model.User, error)
Create(context.Context, *model.User) (*model.User, error)
Update(context.Context, *model.User) (*model.User, error)
Delete(context.Context, string) error
ListTeams(context.Context, string) ([]*model.TeamUser, error)
AppendTeam(context.Context, string, string, string) error
PermitTeam(context.Context, string, string, string) error
DropTeam(context.Context, string, string) error
}
Store defines the interface to persist users.
type TracingRequestID ¶
TracingRequestID returns the request ID as string for tracing
Click to show internal directories.
Click to hide internal directories.