util

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 7 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 OpenAPISchema

func OpenAPISchema[T ~string](r huma.Registry, enumName string, values []T) *huma.Schema

based on https://github.com/danielgtaylor/huma/issues/621#issuecomment-2456588788

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.

Types

type WaitTimeout

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

Jump to

Keyboard shortcuts

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