Documentation ¶
Index ¶
- func AppendToClientContext(ctx context.Context, kv ...string) context.Context
- func MergeToClientContext(ctx context.Context, cmd Metadata) context.Context
- func NewClientContext(ctx context.Context, md Metadata) context.Context
- func NewServerContext(ctx context.Context, md Metadata) context.Context
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToClientContext ¶
AppendToClientContext returns a new context with the provided kv merged with any existing metadata in the context.
func MergeToClientContext ¶
MergeToClientContext merge new metadata into ctx.
func NewClientContext ¶
NewClientContext creates a new context with client md attached.
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 FromClientContext ¶
FromClientContext returns the client metadata in ctx if it exists.
func FromServerContext ¶
FromServerContext returns the server metadata in ctx if it exists.
Click to show internal directories.
Click to hide internal directories.