Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCanceled = errors.New("context canceled")
ErrCanceled is the returned when the CancelFunc returned by Merge is called.
Functions ¶
Types ¶
type Key ¶
type Key[Value any] struct { // contains filtered or unexported fields }
Key ...
type OneContext ¶
type OneContext struct {
// contains filtered or unexported fields
}
OneCtx is a context that can be used to wait for one of multiple contexts to be done.
func (*OneContext) Deadline ¶
func (o *OneContext) Deadline() (time.Time, bool)
Deadline returns the minimum deadline among all the contexts.
func (*OneContext) Done ¶
func (o *OneContext) Done() <-chan struct{}
Done returns a channel for cancellation.
func (*OneContext) Err ¶
func (o *OneContext) Err() error
Err returns the first error raised by the contexts, otherwise a nil error.
func (*OneContext) Value ¶
func (o *OneContext) Value(key interface{}) interface{}
Value returns the value associated with the key from one of the contexts.
Click to show internal directories.
Click to hide internal directories.