waiter

package
v1.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 126

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeDelay

func ComputeDelay(attempt int64, minDelay, maxDelay, remainingTime time.Duration) (delay time.Duration, err error)

ComputeDelay computes delay between waiter attempts. The function takes in a current attempt count, minimum delay, maximum delay, and remaining wait time for waiter as input. The inputs minDelay and maxDelay must always be greater than 0, along with minDelay lesser than or equal to maxDelay.

Returns the computed delay and if next attempt count is possible within the given input time constraints. Note that the zeroth attempt results in no delay.

Types

type Logger

type Logger struct {
	// Attempt is the current attempt to be logged
	Attempt int64
}

Logger is the Logger middleware used by the waiter to log an attempt

func (Logger) AddLogger

func (m Logger) AddLogger(stack *middleware.Stack) error

AddLogger is a helper util to add waiter logger after `SetLogger` middleware in

func (*Logger) HandleInitialize

HandleInitialize performs handling of request in initialize stack step

func (*Logger) ID

func (*Logger) ID() string

ID representing the Logger middleware

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL