Documentation ¶
Index ¶
- Variables
- func NewYgoTraceService(params ...interface{}) (interface{}, error)
- type DefaultIDGenerater
- type TraceKey
- type YgoTraceProvider
- func (provider *YgoTraceProvider) Boot(c framework.Container) error
- func (provider *YgoTraceProvider) IsDefer() bool
- func (provider *YgoTraceProvider) Name() string
- func (provider *YgoTraceProvider) Params(c framework.Container) []interface{}
- func (provider *YgoTraceProvider) Register(c framework.Container) framework.NewInstance
- type YgoTraceService
- func (t *YgoTraceService) ExtractHTTP(req *http.Request) *contract.TraceContext
- func (t *YgoTraceService) GetTrace(c context.Context) *contract.TraceContext
- func (t *YgoTraceService) InjectHTTP(req *http.Request, tc *contract.TraceContext) *http.Request
- func (t *YgoTraceService) NewTrace() *contract.TraceContext
- func (t *YgoTraceService) StartSpan(tc *contract.TraceContext) *contract.TraceContext
- func (t *YgoTraceService) ToMap(tc *contract.TraceContext) map[string]string
- func (t *YgoTraceService) WithTrace(c context.Context, trace *contract.TraceContext) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey = TraceKey("trace-key")
Functions ¶
func NewYgoTraceService ¶
func NewYgoTraceService(params ...interface{}) (interface{}, error)
Types ¶
type DefaultIDGenerater ¶
type DefaultIDGenerater func() string
func (DefaultIDGenerater) NewID ¶
func (f DefaultIDGenerater) NewID() string
type YgoTraceProvider ¶
type YgoTraceProvider struct { }
func (*YgoTraceProvider) Boot ¶
func (provider *YgoTraceProvider) Boot(c framework.Container) error
Boot will called when the service instantiate
func (*YgoTraceProvider) IsDefer ¶
func (provider *YgoTraceProvider) IsDefer() bool
IsDefer define whether the service instantiate when first make or register
func (*YgoTraceProvider) Name ¶
func (provider *YgoTraceProvider) Name() string
/ Name define the name for this service
func (*YgoTraceProvider) Params ¶
func (provider *YgoTraceProvider) Params(c framework.Container) []interface{}
Params define the necessary params for NewInstance
func (*YgoTraceProvider) Register ¶
func (provider *YgoTraceProvider) Register(c framework.Container) framework.NewInstance
Register registe a new function for make a service instance
type YgoTraceService ¶
type YgoTraceService struct {
// contains filtered or unexported fields
}
func (*YgoTraceService) ExtractHTTP ¶
func (t *YgoTraceService) ExtractHTTP(req *http.Request) *contract.TraceContext
GetTrace By Http
func (*YgoTraceService) GetTrace ¶
func (t *YgoTraceService) GetTrace(c context.Context) *contract.TraceContext
GetTrace From trace context
func (*YgoTraceService) InjectHTTP ¶
func (t *YgoTraceService) InjectHTTP(req *http.Request, tc *contract.TraceContext) *http.Request
Set Trace to Http
func (*YgoTraceService) NewTrace ¶
func (t *YgoTraceService) NewTrace() *contract.TraceContext
NewTrace generate a new trace
func (*YgoTraceService) StartSpan ¶
func (t *YgoTraceService) StartSpan(tc *contract.TraceContext) *contract.TraceContext
ChildSpan instance a sub trace with new span id
func (*YgoTraceService) ToMap ¶
func (t *YgoTraceService) ToMap(tc *contract.TraceContext) map[string]string
func (*YgoTraceService) WithTrace ¶
func (t *YgoTraceService) 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.