Documentation
¶
Index ¶
- Constants
- func ContextGetToken(ctx context.Context) (string, bool)
- func ContextGetUser(ctx context.Context) (*userpb.User, bool)
- func ContextGetUserID(ctx context.Context) (*userpb.UserId, bool)
- func ContextMustGetToken(ctx context.Context) string
- func ContextMustGetUser(ctx context.Context) *userpb.User
- func ContextSetToken(ctx context.Context, t string) context.Context
- func ContextSetUser(ctx context.Context, u *userpb.User) context.Context
- func ContextSetUserID(ctx context.Context, id *userpb.UserId) context.Context
Constants ¶
View Source
const TokenHeader = "x-access-token"
TokenHeader is the header to be used across grpc and http services to forward the access token.
Variables ¶
This section is empty.
Functions ¶
func ContextGetToken ¶
ContextGetToken returns the token if set in the given context.
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 ContextMustGetToken ¶
ContextMustGetToken panics if token is not in context.
func ContextMustGetUser ¶
ContextMustGetUser panics if user is not in context.
func ContextSetToken ¶
ContextSetToken stores the token in the context.
func ContextSetUser ¶
ContextSetUser stores the user in the context.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.