Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retry ¶
Retry calls the passed function until it returns nil, or the passed timeout expires.
Retries once per second until timeout expires. Returns how long the function retried, and the last error if the command timed out.
func WithContext ¶ added in v1.16.0
WithContext calls the passed function until it returns nil, or the provided context is closed. Make sure to use a context that eventually closes.
Retries once per second until context closes. Returns how long the function retried, and the last error if the context was closed.
Types ¶
type TerminalError ¶
type TerminalError struct {
Cause error
}
TerminalError will stop a Retry loop if returned.
func NewTerminalError ¶
func NewTerminalError(cause error) *TerminalError
NewTerminalError constructs a new TerminalError
func (*TerminalError) Error ¶
func (te *TerminalError) Error() string
Error returns the error message
func (*TerminalError) Unwrap ¶
func (te *TerminalError) Unwrap() error
Unwrap returns the cause of this TerminalError