appx

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

Context is the carrier of request and response

func NewDefaultContext

func NewDefaultContext(logId string, spanName string) *Context

NewDefaultContext 创建 app 默认的context, spanName

func (*Context) Deadline

func (c *Context) Deadline() (deadline time.Time, ok bool)

Deadline returns the time when work done on behalf of this contextx should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.

func (*Context) Done

func (c *Context) Done() <-chan struct{}

Done returns a channel that's closed when work done on behalf of this contextx should be canceled. Done may return nil if this contextx can never be canceled. Successive calls to Done return the same value.

func (*Context) Err

func (c *Context) Err() error

Err returns a non-nil error value after Done is closed, successive calls to Err return the same error. If Done is not yet closed, Err returns nil. If Done is closed, Err returns a non-nil error explaining why: Canceled if the contextx was canceled or DeadlineExceeded if the contextx's deadline passed.

func (*Context) Value

func (c *Context) Value(key interface{}) interface{}

Value returns the value associated with this contextx for key, or nil if no value is associated with key. Successive calls to Value with the same key returns the same result.

Jump to

Keyboard shortcuts

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