Documentation
¶
Overview ¶
Package planutil takes the functionality from the plan package and presents a more high-level API.
Track a deployment's change via the Deployment ID with a blocking call which will wait until the deployment's resources pending plans have finished.
err := planutil.TrackChange(planutil.TrackChangeParams{
TrackChangeParams: plan.TrackChangeParams{
API: &api.API{}, // A real API instance needs to be used.
DeploymentID: "2e9c997ff4d0bfc273da17f549e45e76",
Config: plan.TrackFrequencyConfig{
MaxRetries: 2, // # of API failures to accept. 2-4 recommended.
PollFrequency: time.Second * 5, // 2-10s recommended.
},
},
Format: "text", // "text", "json" or "" are allowed.
Writer: os.Stdout,
)}
if err != nil {
return err
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrackChange ¶
func TrackChange(params TrackChangeParams) error
TrackChange combines the plan.TrackChange and plan.Stream with configurable format and writer ouptuts.
func Wait ¶
func Wait(params plan.TrackChangeParams) error
Wait tracks a deployment's plan change by waiting until the pending plan has finished. It's a blocking call.
Types ¶
type TrackChangeParams ¶
type TrackChangeParams struct {
plan.TrackChangeParams
Writer io.Writer
Format string
}
TrackChangeParams is consumed by TrackChange.
func (TrackChangeParams) Validate ¶
func (params TrackChangeParams) Validate() error
Validate ensures the parameters are usable by the consuming function. Note this doesn't validate plan.TrackChangeParams as it's already validated when plan.TrackChange is called.