mirror of
https://github.com/mmatczuk/go-http-tunnel.git
synced 2026-05-21 06:45:30 -06:00
15 lines
445 B
Go
15 lines
445 B
Go
package tunnel
|
|
|
|
import "time"
|
|
|
|
// Backoff defines behavior of staggering reconnection retries.
|
|
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()
|
|
}
|