context

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ctx

type Ctx struct {
	// contains filtered or unexported fields
}

Ctx is extension of common Context with added Logger.

func Background

func Background() *Ctx

Background is the same as context.Background() but always returns Ctx.

func NewCtxFromContext

func NewCtxFromContext(parent context.Context) *Ctx

NewCtxFromContext creates new Ctx from context.Context.

func TODO

func TODO() *Ctx

TODO is the same as context.TODO() but always returns Ctx.

func WithCancel

func WithCancel(parent context.Context) (ctx *Ctx, cancel context.CancelFunc)

WithCancel is the same as context.WithCancel() but always returns Ctx.

func WithDeadline

func WithDeadline(parent context.Context, d time.Time) (ctx *Ctx, cancel context.CancelFunc)

WithDeadline is the same as context.WithDeadline() but always returns Ctx.

func WithTimeout

func WithTimeout(parent context.Context, timeout time.Duration) (ctx *Ctx, cancel context.CancelFunc)

WithTimeout is the same as context.WithTimeout() but always returns Ctx.

func WithTrace

func WithTrace(parent context.Context, trace string) *Ctx

WithTrace returns a copy of parent with added trace mark.

func WithValue

func WithValue(parent context.Context, key, val interface{}) *Ctx

WithValue is the same as context.WithValue() but always returns Ctx.

func (*Ctx) Deadline

func (ctx *Ctx) Deadline() (deadline time.Time, ok bool)

Deadline implements Deadline() from Context interface.

func (*Ctx) Done

func (ctx *Ctx) Done() <-chan struct{}

Done implements Done() from Context interface.

func (*Ctx) Err

func (ctx *Ctx) Err() error

Err implements Err() from Context interface.

func (*Ctx) Value

func (ctx *Ctx) Value(key interface{}) interface{}

Value implements Value() from Context interface.

Jump to

Keyboard shortcuts

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