context

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

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
	Logger logger.Logger
	// contains filtered or unexported fields
}

func NewContext

func NewContext(basectx gocontext.Context, opts ...ContextOptions) Context

func (Context) Clone added in v1.19.3

func (c Context) Clone() Context

func (Context) Debugf

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

func (Context) Error

func (c Context) Error(err error, msg ...any)

func (Context) Errorf

func (c Context) Errorf(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) Infof added in v1.20.2

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

func (Context) IsDebug

func (c Context) IsDebug() bool

func (Context) IsTrace

func (c Context) IsTrace() bool

func (Context) Logf added in v1.20.2

func (c Context) Logf(level int, format string, args ...interface{})

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) Warnf added in v1.20.2

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

func (Context) WithDeadline added in v1.21.0

func (c Context) WithDeadline(deadline time.Time) (Context, gocontext.CancelFunc)

func (Context) WithDebug added in v1.19.3

func (c Context) WithDebug() Context

func (Context) WithTimeout added in v1.14.2

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

func (Context) WithTrace added in v1.19.3

func (c Context) WithTrace() Context

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