poll

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package poll is an opinionated library for polling in the Signadot CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Poll added in v0.8.0

type Poll struct {
	// contains filtered or unexported fields
}

func NewPoll added in v0.8.0

func NewPoll() *Poll

func (*Poll) Readiness added in v1.3.0

func (p *Poll) Readiness(ctx context.Context, interval time.Duration, fn func() (ready bool, warn, fatal error)) Readiness

func (*Poll) Until added in v0.8.0

func (p *Poll) Until(ctx context.Context, fn UntilFunc) error

Until polls until the given function returns true, or the timeout expires.

func (*Poll) UntilWithError added in v0.8.0

func (p *Poll) UntilWithError(ctx context.Context, fn UntilWithErrorFunc) error

UntilWithError polls until the given function returns true, or the timeout expires. But also can return error so can be pass down to handle proper errors

func (*Poll) WithDelay added in v0.8.0

func (p *Poll) WithDelay(delay time.Duration) *Poll

func (*Poll) WithResetOnLoop added in v0.8.0

func (p *Poll) WithResetOnLoop(resetOnLoop bool) *Poll

func (*Poll) WithTimeout added in v0.8.0

func (p *Poll) WithTimeout(timeout time.Duration) *Poll

type Readiness added in v1.3.0

type Readiness interface {
	Warn() error
	Fatal() error
	Ready() bool
	Stop()
	Stopped() <-chan struct{}
}

type UntilFunc added in v1.3.0

type UntilFunc func(ctx context.Context) bool

type UntilWithErrorFunc added in v1.3.0

type UntilWithErrorFunc func(ctx context.Context) (bool, error)

Jump to

Keyboard shortcuts

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