vtrace

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TraceIdKey = "traceId"
)

Functions

func GenerateTraceId

func GenerateTraceId() string

GenerateTraceId return traceId creates and returns a global unique string in 32 bytes that meets most common usages without strict UUID algorithm. It returns a unique string using default unique algorithm if no `data` is given.

func GetGinContextTraceId

func GetGinContextTraceId(c *gin.Context) string

GetGinContextTraceId get trace id from context

func GetTraceId

func GetTraceId(ctx context.Context) string

func GetTraceIdKey

func GetTraceIdKey() string

func SetTraceId

func SetTraceId(ctx context.Context, prefix string, traceId ...string) context.Context

func SetTraceIdKey

func SetTraceIdKey(traceIdKey string)

Types

type ContextKey

type ContextKey string

func (ContextKey) String

func (c ContextKey) String() string

Jump to

Keyboard shortcuts

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