context

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 3

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(basectx gocontext.Context, 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) GetTracer added in v1.15.1

func (c Context) GetTracer() trace.Tracer

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) WithTimeout added in v1.14.2

func (c Context) WithTimeout(timeout time.Duration) (Context, gocontext.CancelFunc)

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