Documentation
¶
Index ¶
- Constants
- Variables
- func StartSpan(ctx context.Context, name string, o ...trace.SpanStartOption) (context.Context, trace.Span)
- func WrapperKey() ctxKey
- type Context
- func (c *Context) Base() context.Context
- func (c *Context) ErrorLog(err error, fields ...zap.Field)
- func (c *Context) Log(lvl zapcore.Level, msg string, fields ...zap.Field)
- func (c *Context) RespErrorLog(respErr, originErr error, flag string, fields ...zap.Field) error
- func (c *Context) RootSpan() trace.Span
- func (c *Context) SetBase(ctx context.Context)
- func (c *Context) StartSpan(name string, o ...trace.SpanStartOption) trace.Span
- func (c *Context) StartSpanEnd(name string, o ...trace.SpanStartOption) func(options ...trace.SpanEndOption)
- func (c *Context) TraceID() string
- func (c *Context) WithCancel() context.CancelFunc
- func (c *Context) WithCancelCause() context.CancelCauseFunc
- func (c *Context) WithDeadline(d time.Time) context.CancelFunc
- func (c *Context) WithDeadlineCause(d time.Time, cause error) context.CancelFunc
- func (c *Context) WithTimeout(timeout time.Duration) context.CancelFunc
- func (c *Context) WithTimeoutCause(timeout time.Duration, cause error) context.CancelFunc
- func (c *Context) WithValue(key, val any)
- func (c *Context) WithoutCancel()
- func (c *Context) Wrapper() context.Context
Constants ¶
View Source
const (
KindKey = attribute.Key("context.key")
)
Variables ¶
View Source
var ( Tracer = otel.Tracer("context") Meter = otel.Meter("context") )
Functions ¶
func WrapperKey ¶
func WrapperKey() ctxKey
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) RespErrorLog ¶
func (*Context) StartSpanEnd ¶
func (c *Context) StartSpanEnd(name string, o ...trace.SpanStartOption) func(options ...trace.SpanEndOption)
func (*Context) WithCancel ¶
func (c *Context) WithCancel() context.CancelFunc
func (*Context) WithCancelCause ¶
func (c *Context) WithCancelCause() context.CancelCauseFunc
func (*Context) WithDeadline ¶
func (c *Context) WithDeadline(d time.Time) context.CancelFunc
func (*Context) WithDeadlineCause ¶
func (*Context) WithTimeout ¶
func (c *Context) WithTimeout(timeout time.Duration) context.CancelFunc
func (*Context) WithTimeoutCause ¶
func (*Context) WithoutCancel ¶
func (c *Context) WithoutCancel()
Click to show internal directories.
Click to hide internal directories.
