Documentation
¶
Index ¶
- Constants
- func BoolPtr(b bool) *bool
- func BoolToString(b bool) string
- func ContextWithSpan(ctx context.Context, span *PerformanceSpan) context.Context
- func EnablePerformanceTracking()
- func ExecuteWithRetries(fn func() error, numRetries int, base float64, maximum float64) (int, error)
- func ExecuteWithRetriesContext(ctx context.Context, fn func(ctx context.Context) error, numRetries int, ...) (int, error)
- func Float32Ptr(f float32) *float32
- func Float64Ptr(f float64) *float64
- func Int32Ptr(i int32) *int32
- func Int64Ptr(i int64) *int64
- func IntPtr(i int) *int
- func NewUuid() string
- func SetOutputStream(stream io.Writer)
- func StrPtr(s string) *string
- func Try(f func() error) error
- type DataContextType
- type Iterator
- type PerformanceSpan
- func (p *PerformanceSpan) Add(childName string, start bool) *PerformanceSpan
- func (p *PerformanceSpan) AddChild(child *PerformanceSpan)
- func (p *PerformanceSpan) Duration() time.Duration
- func (p *PerformanceSpan) Link(other *PerformanceSpan)
- func (p *PerformanceSpan) Start() *PerformanceSpan
- func (p *PerformanceSpan) Stop() *PerformanceSpan
- func (p *PerformanceSpan) Summarize() string
- type PerformanceSpanType
- type RemoteIPType
- type Stack
- type StartStopper
- type TraceIDType
Constants ¶
const ( FieldTraceID = "traceId" TraceIDKey = TraceIDType("key") RemoteIPKey = RemoteIPType("key") PerformanceSpanKey = PerformanceSpanType("key") HeaderWorkloadLink = "X-Cpln-Workload-Link" HeaderIdentityLink = "X-Cpln-Identity-Link" AuthnTypeBearer = "Bearer" )
Variables ¶
This section is empty.
Functions ¶
func BoolToString ¶
func ContextWithSpan ¶
func ContextWithSpan(ctx context.Context, span *PerformanceSpan) context.Context
ContextWithSpan stores a PerformanceSpan in the context, or adds a child span to the existing span in the context if one exists Returns a new context with the span
func EnablePerformanceTracking ¶
func EnablePerformanceTracking()
func ExecuteWithRetries ¶
func ExecuteWithRetriesContext ¶
func ExecuteWithRetriesContext(ctx context.Context, fn func(ctx context.Context) error, numRetries int, base float64, maximum float64) (int, error)
ExecuteWithRetriesContext is like ExecuteWithRetries but supports context cancellation. The fn receives context so it can also check for cancellation.
func Float32Ptr ¶
func Float64Ptr ¶
func SetOutputStream ¶
Types ¶
type DataContextType ¶
type DataContextType string
type PerformanceSpan ¶
type PerformanceSpan struct {
// contains filtered or unexported fields
}
func AddChildSpan ¶
AddChildSpan retrieves the parent span from context, adds a child span to it, starts the child span, and returns a new context with the child span If no parent span exists in context, creates a new root span
func NewPerformanceSpan ¶
func NewPerformanceSpan(name string) *PerformanceSpan
func SpanFromContext ¶
func SpanFromContext(ctx context.Context) *PerformanceSpan
SpanFromContext retrieves a PerformanceSpan from the context Returns nil if no span is found in the context
func (*PerformanceSpan) Add ¶
func (p *PerformanceSpan) Add(childName string, start bool) *PerformanceSpan
func (*PerformanceSpan) AddChild ¶
func (p *PerformanceSpan) AddChild(child *PerformanceSpan)
func (*PerformanceSpan) Duration ¶
func (p *PerformanceSpan) Duration() time.Duration
func (*PerformanceSpan) Link ¶
func (p *PerformanceSpan) Link(other *PerformanceSpan)
Link is deprecated - use AddChild instead
func (*PerformanceSpan) Start ¶
func (p *PerformanceSpan) Start() *PerformanceSpan
func (*PerformanceSpan) Stop ¶
func (p *PerformanceSpan) Stop() *PerformanceSpan
func (*PerformanceSpan) Summarize ¶
func (p *PerformanceSpan) Summarize() string
type PerformanceSpanType ¶
type PerformanceSpanType string
type RemoteIPType ¶
type RemoteIPType string
type StartStopper ¶
type StartStopper interface {
Start()
Stop()
}
type TraceIDType ¶
type TraceIDType string