context

package
v1.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindKey = attribute.Key("context.key")
)

Variables

This section is empty.

Functions

func Meter added in v1.16.0

func Meter() metric.Meter

func SetMeter added in v1.5.11

func SetMeter(m metric.Meter)

func SetTracer

func SetTracer(t trace.Tracer)

func StartSpan added in v1.16.0

func StartSpan(ctx context.Context, name string, o ...trace.SpanStartOption) (context.Context, trace.Span)

func Tracer added in v1.16.0

func Tracer() trace.Tracer

func WrapperKey added in v1.16.0

func WrapperKey() ctxKey

Types

type Context

type Context struct {
	TraceID string
	// contains filtered or unexported fields
}

func FromContextValue added in v1.16.0

func FromContextValue(ctx context.Context) *Context

func NewContext

func NewContext(ctx context.Context) *Context

func (*Context) BaseContext added in v1.16.0

func (c *Context) BaseContext() context.Context

func (*Context) Error added in v1.16.0

func (c *Context) Error(args ...interface{})

func (*Context) ErrorLog added in v1.16.0

func (c *Context) ErrorLog(err, originErr error, funcName string) error

func (*Context) HandleError added in v1.16.0

func (c *Context) HandleError(err error)

func (*Context) RootSpan added in v1.16.0

func (c *Context) RootSpan() trace.Span

func (*Context) SetBaseContext added in v1.16.0

func (c *Context) SetBaseContext(ctx context.Context)

func (*Context) StartSpan

func (c *Context) StartSpan(name string, o ...trace.SpanStartOption) trace.Span

func (*Context) StartSpanEnd added in v1.16.0

func (c *Context) StartSpanEnd(name string, o ...trace.SpanStartOption) func(options ...trace.SpanEndOption)

func (*Context) StartSpanX added in v1.16.0

func (c *Context) StartSpanX(name string, o ...trace.SpanStartOption) (*Context, trace.Span)

func (*Context) Wrapper added in v1.16.0

func (c *Context) Wrapper() context.Context

type ValueContext added in v1.16.0

type ValueContext[V any] struct {
	Context
	Value V
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL