Movatterモバイル変換


[0]ホーム

URL:


baggage

package
v1.39.0Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License:Apache-2.0, BSD-3-ClauseImports:1Imported by:0

Details

Repository

github.com/open-telemetry/opentelemetry-go

Links

Documentation

Overview

Package baggage provides base types and functionality to store and retrievebaggage in Go context. This package exists because the OpenTracing bridge toOpenTelemetry needs to synchronize state whenever baggage for a context ismodified and that context contains an OpenTracing span. If it were not forthis need this package would not need to exist and the`go.opentelemetry.io/otel/baggage` package would be the singular place whereW3C baggage is handled.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcContextWithGetHook

func ContextWithGetHook(parentcontext.Context, hookGetHookFunc)context.Context

ContextWithGetHook returns a copy of parent with hook configured to beinvoked every time FromContext is called.

Passing nil GetHookFunc creates a context with no get hook to call.

funcContextWithListadded inv1.0.0

func ContextWithList(parentcontext.Context, listList)context.Context

ContextWithList returns a copy of parent with baggage. Passing nil listreturns a context without any baggage.

funcContextWithSetHook

func ContextWithSetHook(parentcontext.Context, hookSetHookFunc)context.Context

ContextWithSetHook returns a copy of parent with hook configured to beinvoked every time ContextWithBaggage is called.

Passing nil SetHookFunc creates a context with no set hook to call.

Types

typeGetHookFunc

type GetHookFunc func(context.Context,List)List

GetHookFunc is a callback called when getting baggage from the context.

typeItemadded inv1.0.0

type Item struct {ValuestringProperties []Property}

Item is the value and metadata properties part of a list-member.

typeListadded inv1.0.0

type List map[string]Item

List is the collection of baggage members. The W3C allows for duplicates,but OpenTelemetry does not, therefore, this is represented as a map.

funcListFromContextadded inv1.0.0

func ListFromContext(ctxcontext.Context)List

ListFromContext returns the baggage contained in ctx.

typePropertyadded inv1.0.0

type Property struct {Key, Valuestring// HasValue indicates if a zero-value value means the property does not// have a value or if it was the zero-value.HasValuebool}

Property is a metadata entry for a list-member.

typeSetHookFunc

type SetHookFunc func(context.Context,List)context.Context

SetHookFunc is a callback called when storing baggage in the context.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp