Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrForbidden = errors.New("forbidden access")
ErrForbidden occurs when user is identified but not authorized
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface {
// IsAuthorized checks if given user is authorized
IsAuthorized(context.Context, model.User, string) bool
}
Provider provides methods for dealing with identification
type Service ¶ added in v2.11.3
type Service interface {
Get(context.Context, uint64) (model.User, error)
Create(context.Context, model.User) (model.User, error)
Update(context.Context, model.User) (model.User, error)
Delete(context.Context, model.User) error
Check(context.Context, model.User, model.User) error
}
Service defines interaction with storage and provider from User
type Storage ¶ added in v2.11.3
type Storage interface {
DoAtomic(context.Context, func(context.Context) error) error
Get(context.Context, uint64) (model.User, error)
Create(context.Context, model.User) (uint64, error)
Update(context.Context, model.User) error
Delete(context.Context, model.User) error
}
Storage defines interaction with storage from User
Click to show internal directories.
Click to hide internal directories.