docs: add package and exported symbol comments for revive lint compliance

This commit is contained in:
ryan
2026-06-09 13:42:06 +08:00
parent 4ac9857fe8
commit b05d26c9c6
40 changed files with 87 additions and 0 deletions
+1
View File
@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package otel_trace 提供 OpenTelemetry 链路追踪封装工具
package otel_trace
import "go.opentelemetry.io/otel/propagation"
+3
View File
@@ -25,6 +25,7 @@ import (
"go.opentelemetry.io/otel/trace"
)
// Tracer 全局 OpenTelemetry Tracer 实例
var Tracer trace.Tracer
var shutdownFuncs []func(context.Context) error
@@ -45,6 +46,7 @@ func init() {
Tracer = tracerProvider.Tracer("github.com/Rain-kl/Wavelet")
}
// Shutdown 关闭所有 Trace Provider
func Shutdown(ctx context.Context) {
for _, fn := range shutdownFuncs {
_ = fn(ctx)
@@ -52,6 +54,7 @@ func Shutdown(ctx context.Context) {
shutdownFuncs = nil
}
// Start 创建一个新的 Trace Span
func Start(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
return Tracer.Start(ctx, name, opts...)
}