tracecontext

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextFromHeaders

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

func ContextWithTrace

func ContextWithTrace(ctx context.Context, traceID string, spanID string) context.Context

func ExtractCarrier

func ExtractCarrier(ctx context.Context, carrier Carrier) context.Context

func ExtractHTTPHeader

func ExtractHTTPHeader(ctx context.Context, header http.Header) context.Context

func HeaderValue

func HeaderValue(headers map[string]string, key string) string

func HeadersFromContext

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

func InjectCarrier

func InjectCarrier(ctx context.Context, carrier Carrier)

func InjectHTTPHeader

func InjectHTTPHeader(ctx context.Context, header http.Header)

func RequestID

func RequestID(ctx context.Context) string

func SpanID

func SpanID(ctx context.Context) string

func SpanIDFromHeaders

func SpanIDFromHeaders(headers map[string]string) string

func TraceID

func TraceID(ctx context.Context) string

func TraceIDFromHeaders

func TraceIDFromHeaders(headers map[string]string) string

func Traceparent

func Traceparent(ctx context.Context) string

Types

type Carrier

type Carrier interface {
	Get(string) string
	Set(string, string)
}

type HeaderCarrier

type HeaderCarrier http.Header

func (HeaderCarrier) Get

func (c HeaderCarrier) Get(key string) string

func (HeaderCarrier) Keys

func (c HeaderCarrier) Keys() []string

func (HeaderCarrier) Set

func (c HeaderCarrier) Set(key string, value string)

type KeyCarrier

type KeyCarrier interface {
	Carrier
	Keys() []string
}

type MapCarrier

type MapCarrier map[string]string

func (MapCarrier) Get

func (c MapCarrier) Get(key string) string

func (MapCarrier) Keys

func (c MapCarrier) Keys() []string

func (MapCarrier) Set

func (c MapCarrier) Set(key string, value string)

Jump to

Keyboard shortcuts

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