conditions

package
v0.8.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssertionFunc

type AssertionFunc func(ctx context.Context) error

AssertionFunc is called every poll interval until it returns nil.

type Condition

type Condition interface {
	fmt.Stringer
	Wait(ctx context.Context) error
}

Condition is a object which Wait()s for some condition to become true.

Condition can describe itself via String() method.

func None

func None() Condition

None is a service condition that has no conditions.

func PollingCondition

func PollingCondition(description string, assertion AssertionFunc, timeout, interval time.Duration) Condition

PollingCondition converts AssertionFunc into Condition by calling it every interval until timeout is reached.

func WaitForAll

func WaitForAll(conditions ...Condition) Condition

WaitForAll creates a condition which waits for all the conditions to be successful.

func WaitForFileToExist

func WaitForFileToExist(filename string) Condition

WaitForFileToExist is a service condition that will wait for the existence of a file.

func WaitForFilesToExist

func WaitForFilesToExist(filenames ...string) Condition

WaitForFilesToExist is a service condition that will wait for the existence of all the files.

Jump to

Keyboard shortcuts

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