Documentation ¶
Overview ¶
Package metadata is a way of defining message headers
Package metadata is a way of defining message headers
Index ¶
- func Delete(ctx context.Context, k string) context.Context
- func Get(ctx context.Context, key string) (string, bool)
- func MergeContext(ctx context.Context, patchMd Metadata, overwrite bool) context.Context
- func NewContext(ctx context.Context, md Metadata) context.Contextdeprecated
- func NewIncomingContext(ctx context.Context, md Metadata) context.Context
- func NewOutgoingContext(ctx context.Context, md Metadata) context.Context
- func Set(ctx context.Context, k, v string) context.Context
- func SetIncomingContext(ctx context.Context, md Metadata) bool
- func SetOutgoingContext(ctx context.Context, md Metadata) bool
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeContext ¶
MergeContext merges metadata to existing metadata, overwriting if specified
func NewIncomingContext ¶
NewIncomingContext creates a new context with incoming metadata attached
func NewOutgoingContext ¶
NewOutgoingContext creates a new context with outcoming metadata attached
func SetIncomingContext ¶
SetIncomingContext modify incoming context with given metadata
Types ¶
type Metadata ¶
Metadata is our way of representing request headers internally. They're used at the RPC level and translate back and forth from Transport headers.
func FromContext
deprecated
func FromIncomingContext ¶
FromIncomingContext returns metadata from incoming ctx returned metadata shoud not be modified or race condition happens
func FromOutgoingContext ¶
FromOutgoingContext returns metadata from outgoing ctx returned metadata shoud not be modified or race condition happens