Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrWantRefresh = errors.New("want refresh")
Functions ¶
func FriendlyName ¶
func FriendlyName(f interface{}) string
FriendlyName returns a "friendly" stringified name of the given func. This consists of removing the ARO base package name (so it produces pkg/foobar instead of github.com/Azure/ARO-RP/pkg/foobar) and removing the -fm suffix from Golang struct methods.
func Run ¶
func Run(ctx context.Context, log *logrus.Entry, pollInterval time.Duration, steps []Step, now func() time.Time) (map[string]int64, error)
Run executes the provided steps in order until one fails or all steps are completed. Errors from failed steps are returned directly. time cost for each step run will be recorded for metrics usage
Types ¶
type Step ¶
type Step interface { String() string // contains filtered or unexported methods }
Step is the interface for steps that Runner can execute.
func Action ¶
func Action(f actionFunction) Step
Action returns a Step which will execute the action function `f`. Errors from `f` are returned directly.
func AuthorizationRetryingAction ¶
func AuthorizationRetryingAction(r refreshable.Authorizer, action actionFunction) Step
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 ¶
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. If fail is set to false - it will not fail after timeout.