trace

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewNiceTraceService

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

Types

type KeyTrace

type KeyTrace string

type NiceTraceProvider

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

func (*NiceTraceProvider) Boot

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

Boot will called when the service instantiate

func (*NiceTraceProvider) IsDefer

func (provider *NiceTraceProvider) IsDefer() bool

IsDefer define whether the service instantiate when first make or register

func (*NiceTraceProvider) Name

func (provider *NiceTraceProvider) Name() string

Name / Name define the name for this service

func (*NiceTraceProvider) Params

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

Params define the necessary params for NewInstance

func (*NiceTraceProvider) Register

Register registe a new function for make a service instance

type NiceTraceService

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

func (*NiceTraceService) ExtractHTTP

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

ExtractHTTP GetTrace By Http

func (*NiceTraceService) GetTrace

GetTrace From trace context

func (*NiceTraceService) InjectHTTP

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

InjectHTTP Set Trace to Http

func (*NiceTraceService) NewTrace

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

NewTrace generate a new trace

func (*NiceTraceService) StartSpan

StartSpan ChildSpan instance a sub trace with new span id

func (*NiceTraceService) ToMap

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