Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CombinedContext ¶
type CombinedContext struct {
// contains filtered or unexported fields
}
func CombineContext ¶
func CombineContext(contexts ...context.Context) *CombinedContext
CombineContext return combined context: common deadline, values, close. Minimum one of underly contexts MUST be closed for prevent memory leak.
func (*CombinedContext) Deadline ¶
func (cc *CombinedContext) Deadline() (deadline time.Time, ok bool)
Deadline return minimum of contextx deadlines, if present
func (*CombinedContext) Done ¶
func (cc *CombinedContext) Done() <-chan struct{}
Done return channel, that will close when first of initial contexts will closed
func (*CombinedContext) Err ¶
func (cc *CombinedContext) Err() error
Err return error, of context, which close handled first
func (*CombinedContext) Value ¶
func (cc *CombinedContext) Value(key interface{}) interface{}
Value return value of key. It iterate over initial context one by one and return first not nil value. If all of contextx return nil - return nil too
Click to show internal directories.
Click to hide internal directories.