util

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WaitTimedOut = xerrors.New("timeout waiting for condition")

Functions

func GetUnexportedField added in v0.2.1

func GetUnexportedField[T any](obj *T, fieldName string) any

Based on https://stackoverflow.com/a/60598827

func WaitFor

func WaitFor(ctx context.Context, timeout WaitTimeout, condition func() (bool, error)) error

WaitFor waits for a condition to be true or the timeout to expire. It will wait for the condition to be true with exponential backoff. A single sleep timer is reused across iterations via Reset so that mock-clock tests always have a pending timer to advance.

Types

type WaitTimeout

type WaitTimeout struct {
	Timeout     time.Duration
	MinInterval time.Duration
	MaxInterval time.Duration
	InitialWait bool
	Clock       quartz.Clock
}

Jump to

Keyboard shortcuts

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