Source File
counter.go
Belonging Package
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter
// Code generated by gotmpl. DO NOT MODIFY.// source: internal/shared/counter/counter.go.tmpl// Copyright The OpenTelemetry Authors// SPDX-License-Identifier: Apache-2.0// Package counter provides a simple counter for generating unique IDs.//// This package is used to generate unique IDs while allowing testing packages// to reset the counter.package counter // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/counter"import// exporterN is a global 0-based count of the number of exporters created.var exporterN atomic.Int64// NextExporterID returns the next unique ID for an exporter.func () int64 {const = 1return exporterN.Add() -}// SetExporterID sets the exporter ID counter to v and returns the previous// value.//// This function is useful for testing purposes, allowing you to reset the// counter. It should not be used in production code.func ( int64) int64 {return exporterN.Swap()}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |