trace

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TraceIDKey 常量定义
	TraceIDKey = "trace_id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context 上下文定义结构体

func DefaultTraceContext

func DefaultTraceContext() *Context

DefaultTraceContext 获取默认Context实例

func WithTraceID

func WithTraceID(traceID string) *Context

WithTraceID 根据trace ID获取Context实例

func (*Context) Deadline

func (tc *Context) Deadline() (deadline time.Time, ok bool)

Deadline 默认实现

func (*Context) Done

func (tc *Context) Done() <-chan struct{}

Done 默认实现

func (*Context) Err

func (tc *Context) Err() error

Err 默认实现

func (*Context) GetTraceID

func (tc *Context) GetTraceID() string

GetTraceID 获取trace ID

func (*Context) SetTraceID

func (tc *Context) SetTraceID(traceID string)

SetTraceID 设置trace ID

func (*Context) Value

func (tc *Context) Value(key interface{}) interface{}

Value 根据key获取value

Jump to

Keyboard shortcuts

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