baggage.go 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. /*
  4. Package baggage provides base types and functionality to store and retrieve
  5. baggage in Go context. This package exists because the OpenTracing bridge to
  6. OpenTelemetry needs to synchronize state whenever baggage for a context is
  7. modified and that context contains an OpenTracing span. If it were not for
  8. this need this package would not need to exist and the
  9. `go.opentelemetry.io/otel/baggage` package would be the singular place where
  10. W3C baggage is handled.
  11. */
  12. package baggage // import "go.opentelemetry.io/otel/internal/baggage"
  13. // List is the collection of baggage members. The W3C allows for duplicates,
  14. // but OpenTelemetry does not, therefore, this is represented as a map.
  15. type List map[string]Item
  16. // Item is the value and metadata properties part of a list-member.
  17. type Item struct {
  18. Value string
  19. Properties []Property
  20. }
  21. // Property is a metadata entry for a list-member.
  22. type Property struct {
  23. Key, Value string
  24. // HasValue indicates if a zero-value value means the property does not
  25. // have a value or if it was the zero-value.
  26. HasValue bool
  27. }