waitfor

package
v3.0.0-beta10 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(expected bool, timeout, interval time.Duration, fn func() bool) bool

Bool waits for fn() to return the specified expected result (either true or false) within a defined timeout period, checking at each interval.

func BoolCtx

func BoolCtx(ctx context.Context, expected bool, timeout, interval time.Duration, fn func() bool) bool

Boolctx waits for fn() to return the specified expected result (either true or false) while context (with timeout if timeout > 0) is not done or canceled, checking at each interval.

func BoolNoError

func BoolNoError(expected bool, timeout, interval time.Duration, fn func() (bool, error)) (bool, error)

BoolNoError waits for fn() to return the specified expected result (either true or false) without error within a defined timeout period, checking at each interval.

returns:
   false, err: on first fn() with non nil error
   true, nil: on first fn() that returns true, nil
   false, nil: when timeout is reached

func BoolNoErrorCtx

func BoolNoErrorCtx(ctx context.Context, expected bool, timeout, interval time.Duration, fn func() (bool, error)) (bool, error)

BoolNoErrorCtx waits for fn() to return the specified expected result (either true or false) without error while context (with timeout if timeout > 0) is not done checking at each interval.

returns:
   false, err: on first fn() with non nil error
   true, nil: on first fn() that returns true, nil
   false, nil: when context is done

func False

func False(timeout, interval time.Duration, fn func() bool) bool

False waits for fn() to return false within a defined timeout period, checking at each interval.

func FalseCtx

func FalseCtx(ctx context.Context, timeout, interval time.Duration, fn func() bool) bool

FalseCtx waits for fn() to return false while context (with timeout if timeout > 0) is not done or canceled, checking at each interval.

func FalseNoError

func FalseNoError(timeout, interval time.Duration, fn func() (bool, error)) (bool, error)

FalseNoError is BoolNoError with expected value false

func FalseNoErrorCtx

func FalseNoErrorCtx(ctx context.Context, timeout, interval time.Duration, fn func() (bool, error)) (bool, error)

FalseNoErrorCtx is BoolNoErrorCtx with expected value false

func True

func True(timeout, interval time.Duration, fn func() bool) bool

True waits for fn() to return true within a defined timeout period, checking at each interval.

func TrueCtx

func TrueCtx(ctx context.Context, timeout, interval time.Duration, fn func() bool) bool

TrueCtx waits for fn() to return true while context (with timeout if timeout > 0) is not done or canceled, checking at each interval.

func TrueNoError

func TrueNoError(timeout, interval time.Duration, fn func() (bool, error)) (bool, error)

TrueNoError is BoolNoError with expected value true

func TrueNoErrorCtx

func TrueNoErrorCtx(ctx context.Context, timeout, interval time.Duration, fn func() (bool, error)) (bool, error)

TrueNoErrorCtx is BoolNoErrorCtx with expected value true

Types

This section is empty.

Jump to

Keyboard shortcuts

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