Documentation ¶
Overview ¶
The TracyGo package provides functionality for tracing a correlation identifier through multiple go microservices.
Index ¶
- type Option
- type TracyGo
- func (t *TracyGo) CorrelationIDKey() string
- func (t *TracyGo) CorrelationIDromContext(ctx context.Context) string
- func (t *TracyGo) NewContextWithCorrelationID(ctx context.Context, correlationID string) context.Context
- func (t *TracyGo) NewContextWithRequestID(ctx context.Context, requestID string) context.Context
- func (t *TracyGo) RequestIDFromContext(ctx context.Context) string
- func (t *TracyGo) RequestIDKey() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(tracy *TracyGo)
Option is an optional func.
func WithCorrelationID ¶
WithCorrelationID returns a function that sets the key for the correlation id header.
func WithRequestID ¶
WithRequestID returns a function that sets the key for the request id header.
type TracyGo ¶
type TracyGo struct {
// contains filtered or unexported fields
}
TracyGo is a struct for the tracy object.
func (*TracyGo) CorrelationIDKey ¶ added in v2.1.0
CorrelationIDKey returns the underlying correlation id key.
func (*TracyGo) CorrelationIDromContext ¶ added in v2.1.0
FromContext returns the correlation id from the given context, or the an empty string.
func (*TracyGo) NewContextWithCorrelationID ¶ added in v2.1.0
func (t *TracyGo) NewContextWithCorrelationID(ctx context.Context, correlationID string) context.Context
NewContextWithCorrelationID sets the correlation id to use in the given context. If ctx is nil, a new context without value is created.
func (*TracyGo) NewContextWithRequestID ¶ added in v2.1.0
NewContextWithRequestID sets the request id to use in the given context. If ctx is nil, a new context without value is created.
func (*TracyGo) RequestIDFromContext ¶ added in v2.1.0
FromContext returns the correlationID from the given context, or the an empty string.
func (*TracyGo) RequestIDKey ¶ added in v2.1.0
RequestIDKey returns the underlying request id key.