embedded.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. // Package embedded provides interfaces embedded within the [OpenTelemetry
  4. // trace API].
  5. //
  6. // Implementers of the [OpenTelemetry trace API] can embed the relevant type
  7. // from this package into their implementation directly. Doing so will result
  8. // in a compilation error for users when the [OpenTelemetry trace API] is
  9. // extended (which is something that can happen without a major version bump of
  10. // the API package).
  11. //
  12. // [OpenTelemetry trace API]: https://pkg.go.dev/go.opentelemetry.io/otel/trace
  13. package embedded // import "go.opentelemetry.io/otel/trace/embedded"
  14. // TracerProvider is embedded in
  15. // [go.opentelemetry.io/otel/trace.TracerProvider].
  16. //
  17. // Embed this interface in your implementation of the
  18. // [go.opentelemetry.io/otel/trace.TracerProvider] if you want users to
  19. // experience a compilation error, signaling they need to update to your latest
  20. // implementation, when the [go.opentelemetry.io/otel/trace.TracerProvider]
  21. // interface is extended (which is something that can happen without a major
  22. // version bump of the API package).
  23. type TracerProvider interface{ tracerProvider() }
  24. // Tracer is embedded in [go.opentelemetry.io/otel/trace.Tracer].
  25. //
  26. // Embed this interface in your implementation of the
  27. // [go.opentelemetry.io/otel/trace.Tracer] if you want users to experience a
  28. // compilation error, signaling they need to update to your latest
  29. // implementation, when the [go.opentelemetry.io/otel/trace.Tracer] interface
  30. // is extended (which is something that can happen without a major version bump
  31. // of the API package).
  32. type Tracer interface{ tracer() }
  33. // Span is embedded in [go.opentelemetry.io/otel/trace.Span].
  34. //
  35. // Embed this interface in your implementation of the
  36. // [go.opentelemetry.io/otel/trace.Span] if you want users to experience a
  37. // compilation error, signaling they need to update to your latest
  38. // implementation, when the [go.opentelemetry.io/otel/trace.Span] interface is
  39. // extended (which is something that can happen without a major version bump of
  40. // the API package).
  41. type Span interface{ span() }