Versions in this module Expand all Collapse all v2 v2.11.6 Dec 15, 2021 v2.11.5 Dec 10, 2021 Changes in this version + var ErrInvalidStrategy = errors.New("auth: Invalid strategy") + func Append(s Strategy, key interface{}, info Info) error + func CtxWithUser(ctx context.Context, info Info) context.Context + func NewTypeError(prefix string, want, got interface{}) error + func RequestWithUser(info Info, r *http.Request) *http.Request + func Revoke(s Strategy, key interface{}) error + func SetInfoConstructor(c InfoConstructor) + type Cache interface + Delete func(key interface{}) + Load func(key interface{}) (interface{}, bool) + Store func(key interface{}, value interface{}) + StoreWithTTL func(key interface{}, value interface{}, ttl time.Duration) + type DefaultUser struct + Extensions Extensions + Groups []string + ID string + Name string + func NewDefaultUser(name, id string, groups []string, extensions Extensions) *DefaultUser + func (d *DefaultUser) GetExtensions() Extensions + func (d *DefaultUser) GetGroups() []string + func (d *DefaultUser) GetID() string + func (d *DefaultUser) GetUserName() string + func (d *DefaultUser) SetExtensions(exts Extensions) + func (d *DefaultUser) SetGroups(groups []string) + func (d *DefaultUser) SetID(id string) + func (d *DefaultUser) SetUserName(name string) + type Extensions map[string][]string + func (exts Extensions) Add(key, value string) + func (exts Extensions) Clone() Extensions + func (exts Extensions) Del(key string) + func (exts Extensions) Get(key string) string + func (exts Extensions) Has(key string) bool + func (exts Extensions) Set(key, value string) + func (exts Extensions) Values(key string) []string + type Info interface + GetExtensions func() Extensions + GetGroups func() []string + GetID func() string + GetUserName func() string + SetExtensions func(exts Extensions) + SetGroups func(groups []string) + SetID func(string) + SetUserName func(string) + func NewUserInfo(name, id string, groups []string, extensions Extensions) Info + func User(r *http.Request) Info + func UserFromCtx(ctx context.Context) Info + type InfoConstructor func(name, id string, groups []string, extensions Extensions) Info + type Option interface + Apply func(v interface{}) + type OptionFunc func(v interface{}) + func (fn OptionFunc) Apply(v interface{}) + type Strategy interface + Authenticate func(ctx context.Context, r *http.Request) (Info, error) + type TypeError struct + Got string + Want string + func (i TypeError) Error() string