metadata

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendMetadataToOutgoingContext

func AppendMetadataToOutgoingContext(ctx context.Context, kv ...string) context.Context

AppendMetadataToOutgoingContext appends key-value pairs to the outgoing context.

func NewContextWithIncomingHeader

func NewContextWithIncomingHeader(ctx context.Context, head *Header) context.Context

NewContextWithIncomingHeader sets the incoming message header to the context.

func NewContextWithOutgoingMetadata

func NewContextWithOutgoingMetadata(ctx context.Context, md Metadata) context.Context

NewContextWithOutgoingMetadata resets any existing outgoing metadata in the context to the one provided.

func WithOutgoingMetadata added in v0.7.0

func WithOutgoingMetadata(ctx context.Context, md Metadata) context.Context

WithOutgoingMetadata adds outgoing metadata to the context.

Types

type Header struct {
	RemoteID string
	SentAt   time.Time
	Metadata Metadata
}

func IncomingHeader

func IncomingHeader(ctx context.Context) *Header

IncomingHeader returns an incoming message header from the context (if any).

type Metadata

type Metadata map[string]string

func OutgoingContextMetadata

func OutgoingContextMetadata(ctx context.Context) Metadata

OutgoingContextMetadata returns a copy of the outgoing metadata set on the context (if any).

Jump to

Keyboard shortcuts

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