| serkant.uluderya | e5afeff | 2021-02-23 18:00:23 +0300 | [diff] [blame] | 1 | // Copyright The OpenTelemetry Authors |
| Abhay Kumar | 40252eb | 2025-10-13 13:25:53 +0000 | [diff] [blame^] | 2 | // SPDX-License-Identifier: Apache-2.0 |
| serkant.uluderya | e5afeff | 2021-02-23 18:00:23 +0300 | [diff] [blame] | 3 | |
| Abhay Kumar | 40252eb | 2025-10-13 13:25:53 +0000 | [diff] [blame^] | 4 | /* |
| 5 | Package baggage provides base types and functionality to store and retrieve |
| 6 | baggage in Go context. This package exists because the OpenTracing bridge to |
| 7 | OpenTelemetry needs to synchronize state whenever baggage for a context is |
| 8 | modified and that context contains an OpenTracing span. If it were not for |
| 9 | this need this package would not need to exist and the |
| 10 | `go.opentelemetry.io/otel/baggage` package would be the singular place where |
| 11 | W3C baggage is handled. |
| 12 | */ |
| 13 | package baggage // import "go.opentelemetry.io/otel/internal/baggage" |
| serkant.uluderya | e5afeff | 2021-02-23 18:00:23 +0300 | [diff] [blame] | 14 | |
| Abhay Kumar | 40252eb | 2025-10-13 13:25:53 +0000 | [diff] [blame^] | 15 | // List is the collection of baggage members. The W3C allows for duplicates, |
| 16 | // but OpenTelemetry does not, therefore, this is represented as a map. |
| 17 | type List map[string]Item |
| serkant.uluderya | e5afeff | 2021-02-23 18:00:23 +0300 | [diff] [blame] | 18 | |
| Abhay Kumar | 40252eb | 2025-10-13 13:25:53 +0000 | [diff] [blame^] | 19 | // Item is the value and metadata properties part of a list-member. |
| 20 | type Item struct { |
| 21 | Value string |
| 22 | Properties []Property |
| serkant.uluderya | e5afeff | 2021-02-23 18:00:23 +0300 | [diff] [blame] | 23 | } |
| 24 | |
| Abhay Kumar | 40252eb | 2025-10-13 13:25:53 +0000 | [diff] [blame^] | 25 | // Property is a metadata entry for a list-member. |
| 26 | type Property struct { |
| 27 | Key, Value string |
| serkant.uluderya | e5afeff | 2021-02-23 18:00:23 +0300 | [diff] [blame] | 28 | |
| Abhay Kumar | 40252eb | 2025-10-13 13:25:53 +0000 | [diff] [blame^] | 29 | // 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.uluderya | e5afeff | 2021-02-23 18:00:23 +0300 | [diff] [blame] | 32 | } |