Documentation ¶
Index ¶
- func WithUser(ctx context.Context, user User) context.Context
- type CtxUser
- func (user CtxUser) Email() string
- func (user CtxUser) GetExternalData(eid string) (string, bool)
- func (user CtxUser) HasRole(role string) bool
- func (user CtxUser) ID() string
- func (user CtxUser) Name() string
- func (user CtxUser) Roles() []string
- func (user CtxUser) WithExternalData(m map[string]string) CtxUser
- func (user CtxUser) WithRoles(roles ...string) CtxUser
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CtxUser ¶
type CtxUser struct {
// contains filtered or unexported fields
}
User is the base user implementation.
type User ¶
type User interface { ID() string Name() string Email() string Roles() []string HasRole(string) bool GetExternalData(string) (string, bool) }
User provides access to key user metadata and roles.
func ForContext ¶
ForContext finds the user from the context. REQUIRES Middleware to have run.
Click to show internal directories.
Click to hide internal directories.