Documentation ¶
Index ¶
- Variables
- type Contextx
- func Background() Contextx
- func BackgroundWithLogger(logger *zap.Logger) Contextx
- func WithCancel(parent Contextx) (Contextx, context.CancelFunc)
- func WithTimeout(parent Contextx, d time.Duration) (Contextx, context.CancelFunc)
- func WithValue(parent Contextx, key interface{}, val interface{}) Contextx
- type Key
Constants ¶
This section is empty.
Variables ¶
var ( // KeyCtx ctx key string KeyCtx = Key("ctx") )
Functions ¶
This section is empty.
Types ¶
type Contextx ¶
Contextx extends google's context to support logging methods
func Background ¶
func Background() Contextx
Background returns a non-nil, empty Context. It is never canceled, has no values, and has no deadline. It is typically used by the main function, initialization, and tests, and as the top-level Context for incoming requests
func BackgroundWithLogger ¶
BackgroundWithLogger returns a non-nil, empty Context. It is never canceled, has no values, and has no deadline. It is typically used by the main function, initialization, and tests, and as the top-level Context for incoming requests
func WithCancel ¶
func WithCancel(parent Contextx) (Contextx, context.CancelFunc)
WithCancel returns a copy of parent with added cancel function
func WithTimeout ¶
WithTimeout returns a copy of parent with timeout condition and cancel function
func (*Contextx) Debug ¶
Debug logs a message at DebugLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func (*Contextx) Error ¶
Error logs a message at ErrorLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.