trace

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextKey = TraceKey("trace-key")

Functions

func NewYgoTraceService

func NewYgoTraceService(params ...interface{}) (interface{}, error)

Types

type DefaultIDGenerater

type DefaultIDGenerater func() string

func (DefaultIDGenerater) NewID

func (f DefaultIDGenerater) NewID() string

type TraceKey

type TraceKey string

type YgoTraceProvider

type YgoTraceProvider struct {
}

func (*YgoTraceProvider) Boot

func (provider *YgoTraceProvider) Boot(c framework.Container) error

Boot will called when the service instantiate

func (*YgoTraceProvider) IsDefer

func (provider *YgoTraceProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*YgoTraceProvider) Name

func (provider *YgoTraceProvider) Name() string

/ Name define the name for this service

func (*YgoTraceProvider) Params

func (provider *YgoTraceProvider) Params(c framework.Container) []interface{}

Params define the necessary params for NewInstance

func (*YgoTraceProvider) Register

Register registe a new function for make a service instance

type YgoTraceService

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

func (*YgoTraceService) ExtractHTTP

func (t *YgoTraceService) ExtractHTTP(req *http.Request) *contract.TraceContext

GetTrace By Http

func (*YgoTraceService) GetTrace

GetTrace From trace context

func (*YgoTraceService) InjectHTTP

func (t *YgoTraceService) InjectHTTP(req *http.Request, tc *contract.TraceContext) *http.Request

Set Trace to Http

func (*YgoTraceService) NewTrace

func (t *YgoTraceService) NewTrace() *contract.TraceContext

NewTrace generate a new trace

func (*YgoTraceService) StartSpan

ChildSpan instance a sub trace with new span id

func (*YgoTraceService) ToMap

func (*YgoTraceService) WithTrace

WithTrace register new trace to context

Jump to

Keyboard shortcuts

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