import "github.com/skx/deployr/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.
New creates our evaluator object, which will execute the supplied statements.
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.
Run evaluates our program, continuing until all statements have been executed - unless an error was encountered.
SetIdentity specifies the SSH identity file to authenticate with
SetNOP specifies whether we should run for real, or not at all.
SetVariable sets the content of a read-only variable
SetVerbose specifies whether we should run verbosely or not.
Package evaluator imports 15 packages (graph) and is imported by 1 packages. Updated 2019-12-14. Refresh now. Tools for package owners.