context

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 31

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	gocontext.Context
	// contains filtered or unexported fields
}

func NewContext

func NewContext(opts ...ContextOptions) *Context

func (*Context) Debugf

func (c *Context) Debugf(format string, args ...interface{})

func (*Context) Error

func (c *Context) Error(err error)

func (*Context) Errorf

func (c *Context) Errorf(err error, format string, args ...interface{})

func (*Context) GetSpan

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

func (*Context) HasSpanStarted

func (c *Context) HasSpanStarted() bool

func (*Context) IsDebug

func (c *Context) IsDebug() bool

func (*Context) IsTrace

func (c *Context) IsTrace() bool

func (*Context) StartSpan

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

func (*Context) Tracef

func (c *Context) Tracef(format string, args ...interface{})

func (*Context) WithTracer

func (c *Context) WithTracer(tracer trace.Tracer)

func (*Context) WithValue

func (c *Context) WithValue(key, val interface{}) *Context

type ContextOptions

type ContextOptions func(*Context)

func WithDebugFn

func WithDebugFn(fn func(*Context) bool) ContextOptions

func WithLogger

func WithLogger(log logger.Logger) ContextOptions

func WithTraceFn

func WithTraceFn(fn func(*Context) bool) ContextOptions

func WithTracer

func WithTracer(tracer trace.Tracer) ContextOptions

Jump to

Keyboard shortcuts

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