Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultBackoffInterval = 500 * time.Millisecond DefaultBackoffMultiplier = 1.5 DefaultBackoffMaxInterval = 60 * time.Second DefaultBackoffMaxTime = 15 * time.Minute )
Default backoff configuration.
View Source
const (
DefaultKeepAliveInterval = 25 * time.Second
)
Default keepAlive configuration.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultKeepAlive ¶
Types ¶
type Backoff ¶
type Backoff interface { // Next returns the duration to sleep before retrying to reconnect. // If the returned value is negative, the retry is aborted. NextBackOff() time.Duration // Reset is used to signal a reconnection was successful and next // call to Next should return desired time duration for 1st reconnection // attempt. Reset() }
Backoff defines behavior of staggering reconnection retries.
type BackoffConfig ¶
type BackoffConfig struct { Interval time.Duration `yaml:"interval"` Multiplier float64 `yaml:"multiplier"` MaxInterval time.Duration `yaml:"max_interval"` MaxTime time.Duration `yaml:"max_time"` }
BackoffConfig defines behavior of staggering reconnection retries.
func NewDefaultBackoffConfig ¶
func NewDefaultBackoffConfig() *BackoffConfig
type KeepAliveConfig ¶
KeepAliveConfig defines if and how the keepAlive package is sent.
func NewDefaultKeepAliveConfig ¶
func NewDefaultKeepAliveConfig() *KeepAliveConfig
func Parse ¶
func Parse(interval string) (*KeepAliveConfig, error)
func (*KeepAliveConfig) String ¶
func (k *KeepAliveConfig) String() string
Click to show internal directories.
Click to hide internal directories.