Documentation ¶
Index ¶
- func AppendToClientContext(ctx context.Context, kv ...string) context.Context
- func Client(opts ...Option) endpoint.Middleware
- 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
- func Server(opts ...Option) endpoint.Middleware
- type Metadata
- type Option
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 Client ¶
func Client(opts ...Option) endpoint.Middleware
Client is middleware client-side metadata.
func MergeToClientContext ¶
MergeToClientContext merge new metadata into ctx.
func NewClientContext ¶
NewClientContext creates a new context with client md attached.
func NewServerContext ¶
NewServerContext creates a new context with client md attached.
func Server ¶
func Server(opts ...Option) endpoint.Middleware
Server is middleware server-side 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 FromClientContext ¶
FromClientContext returns the client metadata in ctx if it exists.
func FromServerContext ¶
FromServerContext returns the server metadata in ctx if it exists.
type Option ¶
type Option func(*options)
Option is metadata option.
func WithConstants ¶
WithConstants with constant metadata key value.
func WithPropagatedPrefix ¶
WithPropagatedPrefix with propagated key prefix.