Documentation
¶
Overview ¶
Package scenario reads scenario files. A scenario is a file of timed actions that plugyard carries out against a running site.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Actions = []string{ control.ActionPlug, control.ActionUnplug, control.ActionTap, control.ActionFault, control.ActionClear, control.ActionOffline, control.ActionOnline, control.ActionReboot, control.ActionFail, control.OpStop, control.OpStart, control.OpRestart, control.OpKill, }
Actions lists what a step can do, in the order help shows them: the actions of "plugyard exec", then the commands that power a charger on and off.
Functions ¶
This section is empty.
Types ¶
type Scenario ¶
type Scenario struct {
Name string
// Steps are in time order, which is also the order of the file.
Steps []Step
}
Scenario is a scenario file.
type Step ¶
type Step struct {
// Number is the step's position in the scenario, counting from 1.
Number int
// At is when the step runs, counted from the start of the run.
At time.Duration
// Charger is a charge point ID, a name, or a pattern.
Charger string
// Do is the action, one of Actions.
Do string
// Request holds the action with its options, for the actions of
// "plugyard exec". Its list of chargers is filled in when the step runs.
Request control.ExecRequest
}
Step is one timed action.