waiter

package
v0.0.0-...-c113622 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package waiter is a helper package use for waiting remote state is transformed into target state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RefreshFunc

type RefreshFunc func() (result interface{}, state string, err error)

RefreshFunc is the function to query remote resource state

type StateWaiter

type StateWaiter struct {
	Pending      []string
	Target       []string
	Refresh      RefreshFunc
	Delay        time.Duration
	Timeout      time.Duration
	MinTimeout   time.Duration
	PollInterval time.Duration
}

StateWaiter is the waiter that waiting for remote state achieve to target state

func (*StateWaiter) Wait

func (waiter *StateWaiter) Wait() (interface{}, error)

Wait watches an object and waits for it to achieve the state

type TimeoutError

type TimeoutError struct {
	LastError      error
	LastState      string
	Timeout        time.Duration
	ExpectedStates []string
}

TimeoutError is returned when WaitForState times out

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

Jump to

Keyboard shortcuts

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