Documentation
¶
Overview ¶
Package reqheaders carries per-request HTTP headers on a context. It has no dependencies beyond the standard library so the core sdk package can import it without pulling in provider helpers.
Index ¶
- func ClientRequestID(ctx context.Context) string
- func FromContext(ctx context.Context) map[string]string
- func Merge(layers ...map[string]string) map[string]string
- func WithClientRequestID(ctx context.Context, id string) context.Context
- func WithContext(ctx context.Context, headers map[string]string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientRequestID ¶
ClientRequestID returns the client request ID carried by ctx, or "" when there is none.
func FromContext ¶
FromContext returns the headers carried by ctx, or nil when there are none. The returned map must not be modified.
func Merge ¶
Merge returns a fresh map with canonical HTTP header names. Later layers override earlier layers without retaining any caller-owned maps.
func WithClientRequestID ¶
WithClientRequestID sets the client request ID carried by ctx, replacing any inherited one. An empty id clears it.
Types ¶
This section is empty.