Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultInterval is the default amount of time to wait in between checks DefaultInterval = 5 * time.Second // DefaultGracePeriod is the amount of time to wait before running the first // check and after a successful check DefaultGracePeriod = time.Duration(0) // DefaultRetries is the default number of times to retry before failing DefaultRetries = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Preparer ¶
type Preparer struct { // the shell interpreter that will be used for your scripts. `/bin/sh` is // used by default. Interpreter string `hcl:"interpreter"` // the script to run to check if a resource is ready. exit with exit code 0 if // the resource is healthy, and 1 (or above) otherwise. Check string `hcl:"check" required:"true" nonempty:"true"` // flags to pass to the `interpreter` binary to check validity. For // `/bin/sh` this is `-n`. CheckFlags []string `hcl:"check_flags"` // flags to pass to the interpreter at execution time. ExecFlags []string `hcl:"exec_flags"` // the amount of time the command will wait before halting forcefully. Timeout *time.Duration `hcl:"timeout"` // the working directory this command should be run in. Dir string `hcl:"dir"` // any environment variables that should be passed to the command. Env map[string]string `hcl:"env"` // the amount of time to wait in between checks. If the interval is not // specified, it will default to 5 seconds. Interval *time.Duration `hcl:"interval"` // the amount of time to wait before running the first check and after a // successful check. If no grace period is specified, no grace period will be // taken into account. GracePeriod *time.Duration `hcl:"grace_period"` // the maximum number of attempts before the wait fails. If the maximum number // of retries is not set, it will default to 5. MaxRetry *int `hcl:"max_retry"` }
Preparer handles wait.query tasks
type Retrier ¶
type Retrier struct { GracePeriod time.Duration Interval time.Duration MaxRetry int RetryCount int Duration time.Duration }
Retrier can be included in resources to provide retry capabilities
func PrepareRetrier ¶
PrepareRetrier generates a Retrier from preparer input
Click to show internal directories.
Click to hide internal directories.