metadata

package
v1.10.5 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestIDKey  = "requestId"
	M2MKey        = "m2m"
	AccountIDsKey = "accountIds"
	AccountIDKey  = "accountId"
	UserIDKey     = "userId"
	EmailKey      = "email"
	FirstNameKey  = "firstName"
	LastNameKey   = "lastName"
	TypeKey       = "type"
	SubTypeKey    = "subType"
	RolesKey      = "roles"
	InternalKey   = "internal"
)

Variables

This section is empty.

Functions

func GetFromContext

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

func HasRole

func HasRole(ctx context.Context, role string) bool

HasRole returns true if the given role string occurs in metadata.roles

func NewContext

func NewContext(ctx context.Context, md Metadata) context.Context

func NewInternalContext added in v1.5.6

func NewInternalContext(ctx context.Context) context.Context

func NewOutgoingContext

func NewOutgoingContext(ctx context.Context) context.Context

func NewRequestID

func NewRequestID() string

Types

type Metadata

type Metadata map[string]string

Metadata is the internal metadata abstraction. It is used to provide a single way of handling metadata throughout different transport layers (gRPC, HTTP, AMQP, ...).

func FromContext

func FromContext(ctx context.Context) (Metadata, bool)

Jump to

Keyboard shortcuts

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