blob: b4f85f44a93e48c6ef50ad07de86e096f2ecb374 [file] [log] [blame]
serkant.uluderyae5afeff2021-02-23 18:00:23 +03001// Copyright The OpenTelemetry Authors
Abhay Kumar40252eb2025-10-13 13:25:53 +00002// SPDX-License-Identifier: Apache-2.0
serkant.uluderyae5afeff2021-02-23 18:00:23 +03003
Abhay Kumar40252eb2025-10-13 13:25:53 +00004/*
5Package baggage provides base types and functionality to store and retrieve
6baggage in Go context. This package exists because the OpenTracing bridge to
7OpenTelemetry needs to synchronize state whenever baggage for a context is
8modified and that context contains an OpenTracing span. If it were not for
9this need this package would not need to exist and the
10`go.opentelemetry.io/otel/baggage` package would be the singular place where
11W3C baggage is handled.
12*/
13package baggage // import "go.opentelemetry.io/otel/internal/baggage"
serkant.uluderyae5afeff2021-02-23 18:00:23 +030014
Abhay Kumar40252eb2025-10-13 13:25:53 +000015// List is the collection of baggage members. The W3C allows for duplicates,
16// but OpenTelemetry does not, therefore, this is represented as a map.
17type List map[string]Item
serkant.uluderyae5afeff2021-02-23 18:00:23 +030018
Abhay Kumar40252eb2025-10-13 13:25:53 +000019// Item is the value and metadata properties part of a list-member.
20type Item struct {
21 Value string
22 Properties []Property
serkant.uluderyae5afeff2021-02-23 18:00:23 +030023}
24
Abhay Kumar40252eb2025-10-13 13:25:53 +000025// Property is a metadata entry for a list-member.
26type Property struct {
27 Key, Value string
serkant.uluderyae5afeff2021-02-23 18:00:23 +030028
Abhay Kumar40252eb2025-10-13 13:25:53 +000029 // HasValue indicates if a zero-value value means the property does not
30 // have a value or if it was the zero-value.
31 HasValue bool
serkant.uluderyae5afeff2021-02-23 18:00:23 +030032}