trace

package
v1.0.73 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(ctx context.Context, trace *Trace) context.Context

Types

type Trace

type Trace struct {
	Callee  string          `json:"callee,omitempty"`
	Caller  string          `json:"caller,omitempty"`
	TraceID string          `json:"trace_id,omitempty"`
	SpanID  string          `json:"span_id,omitempty"`
	ChildID string          `json:"child_id,omitempty"`
	Lang    string          `json:"lang,omitempty"`
	Tag     string          `json:"tag,omitempty"`
	Content json.RawMessage `json:"content,omitempty"`
	Request *http.Request   `json:"-"`
}

func Get

func Get(ctx context.Context) *Trace

func New

func New(req *http.Request, callee string) *Trace

func (*Trace) Clone

func (t *Trace) Clone() *Trace

Clone 深度拷贝克隆

func (*Trace) GenChild

func (t *Trace) GenChild() *Trace

GenChild 生成子trace

func (*Trace) SetHeader

func (t *Trace) SetHeader(header http.Header)

SetHeader 设置到请求头

func (*Trace) String

func (t *Trace) String() string

String 序列化成字符串

Jump to

Keyboard shortcuts

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