repeat

package
v0.0.0-...-a52e8f6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 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.

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=1s"`
	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