Documentation
¶
Overview ¶
Package evaluator is the core of our run-time.
Given a parsed series of statements we execute each of them in turn.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Evaluator ¶
type Evaluator struct { // Program is our parsed program, which is an array of statements. Program []statement.Statement // Identity holds the SSH key to authenticate with Identity string // Verbose is true if the execution should be verbose. Verbose bool // NOP records if we should pretend to work, or work for real. NOP bool // Variables is a map which holds the names/values of all defined // variables. (Being declared/set/updated via the 'Set' primitive.) Variables map[string]string // ROVariables is a map which is similar to Variables, but only // contains values set on the command-line. Variables are looked // for here first. ROVariables map[string]string // Connection holds the SSH-connection to the remote-host. Connection *simplessh.Client // Changed records whether the last copy operaton resulted in a change. Changed bool }
Evaluator holds our internal state.
func (*Evaluator) ConnectTo ¶
ConnectTo opens the SSH connection to the specified target-host.
If a connection is already open then it is maintained, and not replaced. This allows the command-line to override the destination which might be baked into a configuration-recipe.
func (*Evaluator) Run ¶
Run evaluates our program, continuing until all statements have been executed - unless an error was encountered.
func (*Evaluator) SetIdentity ¶
SetIdentity specifies the SSH identity file to authenticate with
func (*Evaluator) SetVariable ¶
SetVariable sets the content of a read-only variable
func (*Evaluator) SetVerbose ¶
SetVerbose specifies whether we should run verbosely or not.