...

Source file src/go.opentelemetry.io/otel/trace/embedded/embedded.go

Documentation: go.opentelemetry.io/otel/trace/embedded

     1  // Copyright The OpenTelemetry Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Package embedded provides interfaces embedded within the [OpenTelemetry
    16  // trace API].
    17  //
    18  // Implementers of the [OpenTelemetry trace API] can embed the relevant type
    19  // from this package into their implementation directly. Doing so will result
    20  // in a compilation error for users when the [OpenTelemetry trace API] is
    21  // extended (which is something that can happen without a major version bump of
    22  // the API package).
    23  //
    24  // [OpenTelemetry trace API]: https://pkg.go.dev/go.opentelemetry.io/otel/trace
    25  package embedded // import "go.opentelemetry.io/otel/trace/embedded"
    26  
    27  // TracerProvider is embedded in
    28  // [go.opentelemetry.io/otel/trace.TracerProvider].
    29  //
    30  // Embed this interface in your implementation of the
    31  // [go.opentelemetry.io/otel/trace.TracerProvider] if you want users to
    32  // experience a compilation error, signaling they need to update to your latest
    33  // implementation, when the [go.opentelemetry.io/otel/trace.TracerProvider]
    34  // interface is extended (which is something that can happen without a major
    35  // version bump of the API package).
    36  type TracerProvider interface{ tracerProvider() }
    37  
    38  // Tracer is embedded in [go.opentelemetry.io/otel/trace.Tracer].
    39  //
    40  // Embed this interface in your implementation of the
    41  // [go.opentelemetry.io/otel/trace.Tracer] if you want users to experience a
    42  // compilation error, signaling they need to update to your latest
    43  // implementation, when the [go.opentelemetry.io/otel/trace.Tracer] interface
    44  // is extended (which is something that can happen without a major version bump
    45  // of the API package).
    46  type Tracer interface{ tracer() }
    47  
    48  // Span is embedded in [go.opentelemetry.io/otel/trace.Span].
    49  //
    50  // Embed this interface in your implementation of the
    51  // [go.opentelemetry.io/otel/trace.Span] if you want users to experience a
    52  // compilation error, signaling they need to update to your latest
    53  // implementation, when the [go.opentelemetry.io/otel/trace.Span] interface is
    54  // extended (which is something that can happen without a major version bump of
    55  // the API package).
    56  type Span interface{ span() }
    57  

View as plain text