Documentation
¶
Index ¶
- Variables
- type CommandEvaluator
- type ExpressionProcessor
- type Scope
- func (c *Scope) AppendGlobals(globals sdk.Vars) sdk.ScopeAccessor
- func (c *Scope) AppendVariables(vars sdk.Vars) sdk.ScopeAccessor
- func (c *Scope) Environ() (env []string)
- func (c *Scope) Environment() sdk.ProjectEnvironment
- func (c *Scope) ExpandVariables(str string) (out string, err error)
- func (c *Scope) Global(varName string) (out string, ok bool)
- func (c *Scope) Scan(vals ...*string) (err error)
- func (c *Scope) Var(varName string) (isLocal bool, out string, ok bool)
- func (c *Scope) Vars() sdk.Vars
Constants ¶
This section is empty.
Variables ¶
var Debug = false
Debug is debug mode flag
Functions ¶
This section is empty.
Types ¶
type CommandEvaluator ¶
CommandEvaluator represents command runner and wraps shell calls
type ExpressionProcessor ¶
type ExpressionProcessor struct {
// contains filtered or unexported fields
}
ExpressionProcessor evaluates template literals inside the string
func NewExpressionProcessor ¶
func NewExpressionProcessor(ctx *Scope) ExpressionProcessor
NewExpressionProcessor creates a new processor instance
func (*ExpressionProcessor) ContainsExpression ¶
func (p *ExpressionProcessor) ContainsExpression(str string) bool
ContainsExpression checks if passed string contains template expressions
func (*ExpressionProcessor) ReadExpression ¶
func (p *ExpressionProcessor) ReadExpression(exp []byte) (result []byte, err error)
ReadExpression evaluates an expression string
func (*ExpressionProcessor) ReadString ¶
func (p *ExpressionProcessor) ReadString(input string) (result string, err error)
ReadString parses and evaluates expressions inside the string
type Scope ¶ added in v0.4.0
type Scope struct { Globals sdk.Vars // Globals is set of global variables for all tasks Variables sdk.Vars // Variables is set of variables for specific job // contains filtered or unexported fields }
Scope contains a set of globals and variables related to specific job
func CreateScope ¶ added in v0.4.0
CreateScope creates a new context
func (*Scope) AppendGlobals ¶ added in v0.4.0
func (c *Scope) AppendGlobals(globals sdk.Vars) sdk.ScopeAccessor
AppendGlobals appends global variables to the context
func (*Scope) AppendVariables ¶ added in v0.4.0
func (c *Scope) AppendVariables(vars sdk.Vars) sdk.ScopeAccessor
AppendVariables appends local variables to the context
func (*Scope) Environment ¶ added in v0.4.0
func (c *Scope) Environment() sdk.ProjectEnvironment
Environment returns information about project environment
func (*Scope) ExpandVariables ¶ added in v0.4.0
ExpandVariables expands an expression stored inside a passed string
func (*Scope) Scan ¶ added in v0.4.0
Scan does the same as ExpandVariables but with multiple variables and updates the value in pointer with expanded value
Useful for bulk mapping of struct fields