trace

package
v0.0.0-...-69d094b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package trace 基于 context 封装一个 trace ID 功能

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureTraceID

func EnsureTraceID(ctx context.Context) context.Context

EnsureTraceID 如果没有 trace id 的话, 那就填充一个并返回

func GetTraceID

func GetTraceID(ctx context.Context) string

GetTraceID 读取 trace ID

func SetTraceID

func SetTraceID(ctx context.Context, traceID ...string) context.Context

SetTraceID 设置一个 trace ID, 如果之前已经设置过, 则会覆盖

func WithTraceID

func WithTraceID(ctx context.Context, traceID ...string) context.Context

WithTraceID 等价于 SetTraceID

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL