Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorGroup ¶
type ErrorGroup struct {
Errors []error
}
ErrorGroup collates errors
func (*ErrorGroup) Add ¶
func (e *ErrorGroup) Add(err error)
Add adds an error to an existing error group
func (*ErrorGroup) Finalize ¶
func (e *ErrorGroup) Finalize() error
Finalize returns an error corresponding to the ErrorGroup state. If there's no errors in the group, finalize returns nil. If there's only one error, Finalize returns that error. Otherwise, Finalize will make a new error consisting of the messages from the constituent errors.
type Future ¶
type Future struct {
// contains filtered or unexported fields
}
Future is a type that is essentially the inverse of a channel. With a channel, you have multiple senders and one receiver. With a future, you can have multiple receivers and one sender. Additionally, a future protects against double-sends. Since this is usually used for returning function results, we also capture and return error values as well. Use NewFuture to initialize.
func (*Future) Fired ¶
Fired returns whether or not a value has been set. If Fired is true, Get won't block.