waiter

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// BackoffPolicyLinear indicates a linear backoff policy,
	BackoffPolicyLinear = "linear"
	// BackoffPolicyExponential indicates an exponential backoff policy.
	BackoffPolicyExponential = "exponential"
)

Constants representing the available backoff policies for retry mechanisms.

Variables

This section is empty.

Functions

func Wait

func Wait(checker checker.Checker, opts ...Option) error

Wait waits for end up of check execution.

func WaitContext

func WaitContext(ctx context.Context, chk checker.Checker, opts ...Option) error

WaitContext waits for end up of check execution.

func WaitParallel

func WaitParallel(checkers []checker.Checker, opts ...Option) error

WaitParallel waits for end up all of checks execution.

func WaitParallelContext

func WaitParallelContext(ctx context.Context, checkers []checker.Checker, opts ...Option) error

WaitParallelContext waits for end up all of checks execution.

func WaitWithContext

func WaitWithContext(ctx context.Context, checker checker.Checker, opts ...Option) error

WaitWithContext waits for end up of check execution. Deprecated: The function will be removed in v3.0.0, please use the WaitContext.

Types

type Check

type Check func(ctx context.Context) error

Check represents the checker's check method.

type Option

type Option func(s *options)

Option configures an options

func WithBackoffCoefficient added in v2.14.0

func WithBackoffCoefficient(backoffCoefficient float64) Option

WithBackoffCoefficient sets the backoffCoefficient for use in retry backoff calculations.

func WithBackoffExponentialMaxInterval added in v2.14.0

func WithBackoffExponentialMaxInterval(backoffExponentialMaxInterval time.Duration) Option

WithBackoffExponentialMaxInterval is a function that returns an Option which sets the maximum interval time duration of the exponential backoff algorithm.

func WithBackoffPolicy added in v2.14.0

func WithBackoffPolicy(backoffPolicy string) Option

WithBackoffPolicy returns an Option that sets the backoff policy for retries

func WithInterval

func WithInterval(interval time.Duration) Option

WithInterval configures time duration for each of checking interval

func WithInvertCheck

func WithInvertCheck(invertCheck bool) Option

WithInvertCheck configures invert checking

func WithLogger

func WithLogger(logger logr.Logger) Option

WithLogger configures waiter logger

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout configures a time limit for whole of checking

Jump to

Keyboard shortcuts

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