Documentation ¶
Index ¶
- Variables
- func NewJadeTraceService(params ...interface{}) (interface{}, error)
- type JadeTraceProvider
- func (provider *JadeTraceProvider) Boot(c framework.Container) error
- func (provider *JadeTraceProvider) IsDefer() bool
- func (provider *JadeTraceProvider) Name() string
- func (provider *JadeTraceProvider) Params(c framework.Container) []interface{}
- func (provider *JadeTraceProvider) Register(c framework.Container) framework.NewInstance
- type JadeTraceService
- func (t *JadeTraceService) ExtractHTTP(req *http.Request) *contract.TraceContext
- func (t *JadeTraceService) GetTrace(c context.Context) *contract.TraceContext
- func (t *JadeTraceService) InjectHTTP(req *http.Request, tc *contract.TraceContext) *http.Request
- func (t *JadeTraceService) NewTrace() *contract.TraceContext
- func (t *JadeTraceService) StartSpan(trace *contract.TraceContext) *contract.TraceContext
- func (t *JadeTraceService) ToMap(tc *contract.TraceContext) map[string]string
- func (t *JadeTraceService) WithTrace(c context.Context, trace *contract.TraceContext) context.Context
- type TraceKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey = TraceKey("trace-key")
Functions ¶
func NewJadeTraceService ¶
func NewJadeTraceService(params ...interface{}) (interface{}, error)
Types ¶
type JadeTraceProvider ¶
type JadeTraceProvider struct {
// contains filtered or unexported fields
}
func (*JadeTraceProvider) Boot ¶
func (provider *JadeTraceProvider) Boot(c framework.Container) error
Boot will called when the service instantiate
func (*JadeTraceProvider) IsDefer ¶
func (provider *JadeTraceProvider) IsDefer() bool
IsDefer define whether the service instantiate when first make or register
func (*JadeTraceProvider) Name ¶
func (provider *JadeTraceProvider) Name() string
/ Name define the name for this service
func (*JadeTraceProvider) Params ¶
func (provider *JadeTraceProvider) Params(c framework.Container) []interface{}
Params define the necessary params for NewInstance
func (*JadeTraceProvider) Register ¶
func (provider *JadeTraceProvider) Register(c framework.Container) framework.NewInstance
Register registe a new function for make a service instance
type JadeTraceService ¶
func (*JadeTraceService) ExtractHTTP ¶
func (t *JadeTraceService) ExtractHTTP(req *http.Request) *contract.TraceContext
GetTrace By Http
func (*JadeTraceService) GetTrace ¶
func (t *JadeTraceService) GetTrace(c context.Context) *contract.TraceContext
GetTrace From trace context
func (*JadeTraceService) InjectHTTP ¶
func (t *JadeTraceService) InjectHTTP(req *http.Request, tc *contract.TraceContext) *http.Request
Set Trace to Http
func (*JadeTraceService) NewTrace ¶
func (t *JadeTraceService) NewTrace() *contract.TraceContext
NewTrace generate a new trace
func (*JadeTraceService) StartSpan ¶
func (t *JadeTraceService) StartSpan(trace *contract.TraceContext) *contract.TraceContext
StartSpan generate cspan for child call
func (*JadeTraceService) ToMap ¶
func (t *JadeTraceService) ToMap(tc *contract.TraceContext) map[string]string
func (*JadeTraceService) WithTrace ¶
func (t *JadeTraceService) WithTrace(c context.Context, trace *contract.TraceContext) context.Context
WithContext register new trace to context
Click to show internal directories.
Click to hide internal directories.