Documentation
¶
Overview ¶
Package metadata provides a canonical map[string]string carried across RPC and message boundaries, plus helpers to attach and read it from a context. It complements pkg/transport's protocol-agnostic Header view: Header adapts http.Header / grpc metadata.MD, while Metadata is the normalized key/value payload used by broker messages and service-to-service propagation.
Index ¶
- func Delete(ctx context.Context, key string) context.Context
- func Get(ctx context.Context, key string) (string, bool)
- func MergeContext(ctx context.Context, patch Metadata, overwrite bool) context.Context
- func NewContext(ctx context.Context, md Metadata) context.Context
- func Set(ctx context.Context, key, val string) context.Context
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeContext ¶
MergeContext returns ctx with patch merged into its existing metadata. When overwrite is false, existing values win over patch.
func NewContext ¶
NewContext returns ctx carrying md.
Types ¶
Click to show internal directories.
Click to hide internal directories.