xtrace

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type XTraceClient added in v0.0.4

type XTraceClient struct {
	// trace信息存储key
	KeyTraceSave string
	// traceId在header中的KEY
	KeyTraceId string
	// ts在header中的KEY
	KeyTs string
	// uri在header中的KEY
	KeyUri string
	// userId在header中的KEY
	KeyUserId string
	// userName在header中的KEY
	KeyUserName string
	// roleId在header中的KEY
	KeyRoleId string
	// 是否从responseHeader里面读取
	ByResponse bool
}

func GenXTraceClient added in v0.0.4

func GenXTraceClient(client XTraceClient) XTraceClient

func GenXTraceClientWithDefault added in v0.2.7

func GenXTraceClientWithDefault(client XTraceClient) XTraceClient

func (*XTraceClient) CleanTraceInfoAll added in v0.2.7

func (t *XTraceClient) CleanTraceInfoAll(irisCtx iris.Context)

* * 从Context环境变量中清理traceInfo

func (*XTraceClient) CleanTraceInfoLite added in v0.2.7

func (t *XTraceClient) CleanTraceInfoLite(irisCtx iris.Context)

* * 从Context环境变量中清理traceInfo

func (*XTraceClient) GetTraceInfo added in v0.2.7

func (t *XTraceClient) GetTraceInfo(ctx context.Context) *XTraceInfo

* * 从Context环境变量中获取traceInfo

func (*XTraceClient) RoleIdFromContext added in v0.2.7

func (t *XTraceClient) RoleIdFromContext(ctx context.Context) uint32

* * 从Context环境变量中获取roleId

func (*XTraceClient) ToTraceContext added in v0.0.4

func (t *XTraceClient) ToTraceContext(irisCtx iris.Context) context.Context

* 获取一个带TraceInfo的Context环境变量

func (*XTraceClient) TraceIdFromContext added in v0.0.4

func (t *XTraceClient) TraceIdFromContext(ctx context.Context) string

* * 从Context环境变量中获取traceId

func (*XTraceClient) TraceTimePoint added in v0.0.4

func (t *XTraceClient) TraceTimePoint(ctx context.Context, eventName string)

* 时间统计插入点 ctx 环境 eventName 事件名称或者步骤名称

func (*XTraceClient) TraceTimePrint added in v0.0.4

func (t *XTraceClient) TraceTimePrint(ctx context.Context) string

* 时间统计打印信息 ctx 环境

func (*XTraceClient) URIFromContext added in v0.2.4

func (t *XTraceClient) URIFromContext(ctx context.Context) string

* * 从Context环境变量中获取URI

func (*XTraceClient) UserIdFromContext added in v0.0.4

func (t *XTraceClient) UserIdFromContext(ctx context.Context) uint

* * 从Context环境变量中获取userId

func (*XTraceClient) UserNameFromContext added in v0.2.7

func (t *XTraceClient) UserNameFromContext(ctx context.Context) string

* * 从Context环境变量中获取userName

type XTraceInfo

type XTraceInfo struct {
	TraceId  string
	TsArr    []int64
	Events   []string
	Uri      string
	UserId   uint
	UserName string
	RoleId   uint32
}

Jump to

Keyboard shortcuts

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