Documentation ¶
Index ¶
- Variables
- func NewNiceTraceService(params ...interface{}) (interface{}, error)
- type KeyTrace
- type NiceTraceProvider
- func (provider *NiceTraceProvider) Boot(c framework.Container) error
- func (provider *NiceTraceProvider) IsDefer() bool
- func (provider *NiceTraceProvider) Name() string
- func (provider *NiceTraceProvider) Params(c framework.Container) []interface{}
- func (provider *NiceTraceProvider) Register(c framework.Container) framework.NewInstance
- type NiceTraceService
- func (t *NiceTraceService) ExtractHTTP(req *http.Request) *contract.TraceContext
- func (t *NiceTraceService) GetTrace(c context.Context) *contract.TraceContext
- func (t *NiceTraceService) InjectHTTP(req *http.Request, tc *contract.TraceContext) *http.Request
- func (t *NiceTraceService) NewTrace() *contract.TraceContext
- func (t *NiceTraceService) StartSpan(tc *contract.TraceContext) *contract.TraceContext
- func (t *NiceTraceService) ToMap(tc *contract.TraceContext) map[string]string
- func (t *NiceTraceService) WithTrace(c context.Context, trace *contract.TraceContext) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey = KeyTrace("trace-key")
Functions ¶
func NewNiceTraceService ¶
func NewNiceTraceService(params ...interface{}) (interface{}, error)
Types ¶
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 ¶
func (provider *NiceTraceProvider) Register(c framework.Container) framework.NewInstance
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 ¶
func (t *NiceTraceService) GetTrace(c context.Context) *contract.TraceContext
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 ¶
func (t *NiceTraceService) StartSpan(tc *contract.TraceContext) *contract.TraceContext
StartSpan ChildSpan instance a sub trace with new span id
func (*NiceTraceService) ToMap ¶
func (t *NiceTraceService) ToMap(tc *contract.TraceContext) map[string]string
func (*NiceTraceService) WithTrace ¶
func (t *NiceTraceService) WithTrace(c context.Context, trace *contract.TraceContext) context.Context
WithTrace register new trace to context
Click to show internal directories.
Click to hide internal directories.