func ContextWithGetHook(parent context.Context, hook GetHookFunc) context.Context
ContextWithGetHook returns a copy of parent with hook configured to be invoked every time FromContext is called.
Passing nil GetHookFunc creates a context with no get hook to call.
func ContextWithList(parent context.Context, list List) context.Context
ContextWithList returns a copy of parent with baggage. Passing nil list returns a context without any baggage.
func ContextWithSetHook(parent context.Context, hook SetHookFunc) context.Context
ContextWithSetHook returns a copy of parent with hook configured to be invoked every time ContextWithBaggage is called.
Passing nil SetHookFunc creates a context with no set hook to call.
GetHookFunc is a callback called when getting baggage from the context.
type GetHookFunc func(context.Context, List) List
Item is the value and metadata properties part of a list-member.
type Item struct { Value string Properties []Property }
List is the collection of baggage members. The W3C allows for duplicates, but OpenTelemetry does not, therefore, this is represented as a map.
type List map[string]Item
func ListFromContext(ctx context.Context) List
ListFromContext returns the baggage contained in ctx.
Property is a metadata entry for a list-member.
type Property struct { Key, Value string // HasValue indicates if a zero-value value means the property does not // have a value or if it was the zero-value. HasValue bool }
SetHookFunc is a callback called when storing baggage in the context.
type SetHookFunc func(context.Context, List) context.Context