Documentation
¶
Overview ¶
Package engine executes a plan, and enforces the two rules that make firing one survivable: the restore record is written first, and it is updated after every single change.
The second rule matters more than it looks. A fire interrupted halfway — network drops, credentials expire, someone hits ctrl-C — must leave a record that says exactly which resources were changed and which were not. Writing the snapshot only at the end would turn an interrupted fire into an account in an unknown state, which is the situation this tool exists to prevent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Executor ¶
type Executor interface {
Apply(ctx context.Context, a model.Action) error
Restore(ctx context.Context, e model.Entry) error
}
Executor performs one change, or undoes one.
type Options ¶
type Options struct {
// DryRun prints what would happen and touches nothing. The default
// everywhere: firing has to be the thing you asked for explicitly.
DryRun bool
// ContinueOnError keeps going when one resource fails. On by default for a
// fire — a single unstoppable resource should not leave the rest running —
// and off for a restore, where an early failure usually means credentials
// are wrong and pressing on would produce a misleading partial success.
ContinueOnError bool
Now func() time.Time
Log *audit.Log
}
Options is how a caller says what kind of run this is. The zero value is the safe one everywhere except ContinueOnError, which each entry point sets deliberately.
type Result ¶
Result is what happened: the snapshot as it now stands, and the counts a caller reports.