Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTimeoutError ¶
IsTimeoutError checks if the provided error is a TimeoutError.
func TimeoutAfter ¶
TimeoutAfter executes the provided function and returns TimeoutError in the case that the execution time of the function exceeded the provided duration. The provided function is passed the timer in case it wishes to reset it. If so, the following pattern must be used:
if !timer.Stop() { return &TimeoutError{} }
timer.Reset(timeout)
Types ¶
type TimeoutError ¶
type TimeoutError struct {
// contains filtered or unexported fields
}
TimeoutError is error returned after timeout occurred.
func (*TimeoutError) Error ¶
func (t *TimeoutError) Error() string
Error implements the Go error interface.
Click to show internal directories.
Click to hide internal directories.