Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultTimeout = time.Second
)
Variables ¶
View Source
var ( // ErrFailover is the error to return from a Func to indicate failure to // obtain a result, and that the next available element should be tried. ErrFailover = errors.New("failover: fail over to next option. not an error") // ErrNoResult indicates that no result was available after performing all // available tries. ErrNoResult = errors.New("failover: no result available") )
Functions ¶
Types ¶
type Options ¶
type Options struct { // Time before first failover attempt. If zero, DefaultTimeout is // used. InitialTimeout time.Duration // Time between failover attempts after the first. If zero, InitialTimeout // is used. To force all failovers to occur in parallel (no staggering), use // a trivially small duration, such as time.Nanosecond. StaggerInterval time.Duration }
Click to show internal directories.
Click to hide internal directories.