trace

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 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 NewHeroTraceService

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

Types

type HeroTraceProvider

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

func (*HeroTraceProvider) Boot

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

Boot will called when the service instantiate

func (*HeroTraceProvider) IsDefer

func (provider *HeroTraceProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*HeroTraceProvider) Name

func (provider *HeroTraceProvider) Name() string

/ Name define the name for this service

func (*HeroTraceProvider) Params

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

Params define the necessary params for NewInstance

func (*HeroTraceProvider) Register

Register registe a new function for make a service instance

type HeroTraceService

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

func (*HeroTraceService) ExtractHTTP

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

GetTrace By Http

func (*HeroTraceService) GetTrace

GetTrace From trace context

func (*HeroTraceService) InjectHTTP

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

Set Trace to Http

func (*HeroTraceService) NewTrace

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

NewTrace generate a new trace

func (*HeroTraceService) StartSpan

ChildSpan instance a sub trace with new span id

func (*HeroTraceService) ToMap

func (*HeroTraceService) 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