reqheaders

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientRequestID

func ClientRequestID(ctx context.Context) string

ClientRequestID returns the client request ID carried by ctx, or "" when there is none.

func FromContext

func FromContext(ctx context.Context) map[string]string

FromContext returns the headers carried by ctx, or nil when there are none. The returned map must not be modified.

func Merge

func Merge(layers ...map[string]string) map[string]string

Merge returns a fresh map with canonical HTTP header names. Later layers override earlier layers without retaining any caller-owned maps.

func WithClientRequestID

func WithClientRequestID(ctx context.Context, id string) context.Context

WithClientRequestID sets the client request ID carried by ctx, replacing any inherited one. An empty id clears it.

func WithContext

func WithContext(ctx context.Context, headers map[string]string) context.Context

WithContext snapshots headers onto ctx, merging any inherited values.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL