user

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: Apache-2.0 Imports: 2 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextGetUser

func ContextGetUser(ctx context.Context) (*userpb.User, bool)

ContextGetUser returns the user if set in the given context.

func ContextGetUserID

func ContextGetUserID(ctx context.Context) (*userpb.UserId, bool)

ContextGetUserID returns the user if set in the given context.

func ContextMustGetUser

func ContextMustGetUser(ctx context.Context) *userpb.User

ContextMustGetUser panics if user is not in context.

func ContextSetUser

func ContextSetUser(ctx context.Context, u *userpb.User) context.Context

ContextSetUser stores the user in the context.

func ContextSetUserID

func ContextSetUserID(ctx context.Context, id *userpb.UserId) context.Context

ContextSetUserID stores the userid 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)
	FindUsers(ctx context.Context, query string) ([]*userpb.User, error)
}

Manager is the interface to implement to manipulate users.

Directories

Path Synopsis
manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL