repeat

package
v0.0.0-...-848b2d1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 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