repeat

package
v0.0.0-...-cc7cbc4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(cfg Config)

func UntilSuccess

func UntilSuccess(ctx context.Context, condition ConditionFunc) error

UntilSuccess repeats given condition as long as it returns an error. wait function should be run with delay because the change of status (SI, SB) is not immediate

Types

type ConditionFunc

type ConditionFunc func() (err error)

ConditionFunc returns nil error if the condition is satisfied, or an error if should be repeated.

type Config

type Config struct {
	Interval time.Duration `envconfig:"default=5s"`
	Timeout  time.Duration `envconfig:"default=5m"`
}

Default constraints

Jump to

Keyboard shortcuts

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