trace

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewOneTraceService

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

Types

type OneTraceProvider

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

func (*OneTraceProvider) Boot

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

Boot will called when the service instantiate

func (*OneTraceProvider) IsDefer

func (provider *OneTraceProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*OneTraceProvider) Name

func (provider *OneTraceProvider) Name() string

/ Name define the name for this service

func (*OneTraceProvider) Params

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

Params define the necessary params for NewInstance

func (*OneTraceProvider) Register

Register registe a new function for make a service instance

type OneTraceService

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

func (*OneTraceService) ExtractHTTP

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

GetTrace By Http

func (*OneTraceService) GetTrace

GetTrace From trace context

func (*OneTraceService) InjectHTTP

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

Set Trace to Http

func (*OneTraceService) NewTrace

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

NewTrace generate a new trace

func (*OneTraceService) StartSpan

ChildSpan instance a sub trace with new span id

func (*OneTraceService) ToMap

func (*OneTraceService) WithTrace

WithTrace register new trace to context

type TraceKey

type TraceKey string

Jump to

Keyboard shortcuts

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