steps

package
v0.0.0-...-823d357 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWantRefresh = errors.New("want refresh")

Functions

func Action

func Action(f actionFunction) actionStep

Action returns a Step which will execute the action function `f`. Errors from `f` are returned directly.

func AuthorizationRefreshingAction

func AuthorizationRefreshingAction(authorizer refreshable.Authorizer, step Step) authorizationRefreshingActionStep

AuthorizationRefreshingAction returns a wrapper Step which will refresh `authorizer` if the step returns an Azure AuthenticationError and rerun it. The step will be retried until `retryTimeout` is hit. Any other error will be returned directly.

func Condition

func Condition(f conditionFunction, timeout time.Duration) conditionStep

Condition returns a Step suitable for checking whether subsequent Steps can be executed.

The Condition will execute f repeatedly (every Runner.pollInterval), timing out with a failure when more time than the provided timeout has elapsed without f returning (true, nil). Errors from `f` are returned directly.

func Run

func Run(ctx context.Context, log *logrus.Entry, pollInterval time.Duration, steps []Step) error

Run executes the provided steps in order until one fails or all steps are completed. Errors from failed steps are returned directly.

Types

type Step

type Step interface {
	String() string
	// contains filtered or unexported methods
}

Step is the interface for steps that Runner can execute.

Jump to

Keyboard shortcuts

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