Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error encapsulates errors in a synchronized way.
type Reasons ¶
type Reasons struct {
// contains filtered or unexported fields
}
Reasons maintains a list of recovery reasons when working with panic recovering. It allows to get statistical information and maintenance of the collected reasons to decide if a recovery makes sense or a loop should be left with an error.
func (*Reasons) Append ¶
func (rs *Reasons) Append(reason interface{})
Append adds a new reason with timestamp to the collection.
func (Reasons) Frequency ¶
Frequency checks if a given number of panics happened during a given duration.
type Signal ¶
type Signal struct {
// contains filtered or unexported fields
}
Signal allows code to be notified about status changes.
type Signaler ¶
type Signaler interface { // Status returns the current goroutine status. Status() Status // Done waits until the given status is notified. Done(status Status) <-chan struct{} // Wait waits until the given status or duration, what comes first. Wait(status Status, timeout time.Duration) error }
Signaler describes types with a status and able to notify others about its changes. It's the read-only interface to a Signal.
Click to show internal directories.
Click to hide internal directories.