Documentation
¶
Index ¶
- func ContextGetUser(ctx context.Context) (*userpb.User, bool)
- func ContextGetUserID(ctx context.Context) (*userpb.UserId, bool)
- func ContextMustGetUser(ctx context.Context) *userpb.User
- func ContextSetUser(ctx context.Context, u *userpb.User) context.Context
- func ContextSetUserID(ctx context.Context, id *userpb.UserId) context.Context
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextGetUser ¶
ContextGetUser returns the user if set in the given context.
func ContextGetUserID ¶
ContextGetUserID returns the user if set in the given context.
func ContextMustGetUser ¶
ContextMustGetUser panics if user is not in context.
func ContextSetUser ¶
ContextSetUser stores the user in the context.
Types ¶
type Manager ¶
type Manager interface { GetUser(ctx context.Context, uid *userpb.UserId) (*userpb.User, error) GetUserByClaim(ctx context.Context, claim, value string) (*userpb.User, error) GetUserGroups(ctx context.Context, uid *userpb.UserId) ([]string, error) IsInGroup(ctx context.Context, uid *userpb.UserId, group string) (bool, error) FindUsers(ctx context.Context, query string) ([]*userpb.User, error) }
Manager is the interface to implement to manipulate users.
Click to show internal directories.
Click to hide internal directories.