Documentation ¶
Overview ¶
Package context provides a Context type to propagate state and cancellation information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCanceled = errors.New("canceled")
ErrCanceled may be returned by code when it receives from a Context.Done channel.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
A Context is carries state and cancellation information between calls. A nil Context pointer is valid, for now.
func TODO ¶
func TODO() *Context
TODO returns a dummy context. It's a signal that the caller code is not yet correct, and needs its own context to propagate.
func (*Context) Done ¶
func (c *Context) Done() <-chan struct{}
Done returns a channel that is closed when the Context is canceled or finished.
func (*Context) HTTPClient ¶
HTTPClient returns the HTTP Client to use for this context.
func (*Context) IsCanceled ¶
IsCanceled reports whether this context has been canceled.
Click to show internal directories.
Click to hide internal directories.