Documentation
¶
Index ¶
- Variables
- type CommandEvaluator
- type Context
- func (c *Context) AppendGlobals(globals Vars) *Context
- func (c *Context) Environ() (env []string)
- func (c *Context) ExpandVariables(str string) (out string, err error)
- func (c *Context) Global(varName string) (out string, ok bool)
- func (c *Context) Var(varName string) (isLocal bool, out string, ok bool)
- type ExpressionProcessor
- type Vars
Constants ¶
This section is empty.
Variables ¶
View Source
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 Context ¶
type Context struct {
Globals Vars // Globals is set of global variables for all tasks
Variables Vars // Variables is set of variables for specific job
Environment struct {
ProjectDirectory string
}
// contains filtered or unexported fields
}
Context contains a set of globals and variables related to specific job
func CreateContext ¶
CreateContext creates a new context
func (*Context) AppendGlobals ¶
AppendGlobals appends global variables to the context
func (*Context) ExpandVariables ¶
ExpandVariables expands an expression stored inside a passed string
type ExpressionProcessor ¶
type ExpressionProcessor struct {
// contains filtered or unexported fields
}
ExpressionProcessor evaluates template literals inside the string
func NewExpressionProcessor ¶
func NewExpressionProcessor(ctx *Context) 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
Click to show internal directories.
Click to hide internal directories.