Documentation ¶
Overview ¶
Package backoff is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff interface { // Backoff waits and blocks the caller for a duration of time depending on the number of attempts, // or until the context is done. Backoff(ctx context.Context, attempts int) }
Backoff is the interface for backoff.
type Exponential ¶
type Exponential struct { BaseBackoff time.Duration // Base backoff duration MaxBackoff time.Duration // Maximum backoff duration }
Exponential implements a backoff strategy that increases the backoff duration exponentially, up to a maximum backoff duration.
func NewExponential ¶
func NewExponential(baseBackoff, maxBackoff time.Duration) *Exponential
type MockBackoff ¶
type MockBackoff struct {
// contains filtered or unexported fields
}
MockBackoff is a mock of Backoff interface.
func NewMockBackoff ¶
func NewMockBackoff(ctrl *gomock.Controller) *MockBackoff
NewMockBackoff creates a new mock instance.
func (*MockBackoff) Backoff ¶
func (m *MockBackoff) Backoff(ctx context.Context, attempts int)
Backoff mocks base method.
func (*MockBackoff) EXPECT ¶
func (m *MockBackoff) EXPECT() *MockBackoffMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockBackoffMockRecorder ¶
type MockBackoffMockRecorder struct {
// contains filtered or unexported fields
}
MockBackoffMockRecorder is the mock recorder for MockBackoff.
Click to show internal directories.
Click to hide internal directories.