ctx_value

package
v0.0.0-...-a67b36e Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: Apache-2.0 Imports: 2 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddValue

func AddValue(ctx context.Context, key string, value interface{}) context.Context

AddValue wrapps the context.WithValue function using a unified ctxKey to store the passed value. Returns a new context.Context with the value

func GetAuthedUser

func GetAuthedUser(ctx context.Context) *common.AuthedUser

GetAuthedUser is a special case where the API middleware adds the authed user coming from the TokenService to the context. Claims of user might be needed afterwards. GetAuthedUser is tide to the grpc_def of TokenService.AuthenticatedUser and if not found will return nil

func GetString

func GetString(ctx context.Context, key string) string

GetString returns a string value from a given context or an empty string "" if value is nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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