Documentation ¶
Index ¶
- Variables
- func Compile(tpl *Template, env *Env, mode ...Mode) (*Template, *Env, error)
- func IsRevertible(t *Template) bool
- func MatchStringParamValue(s string) bool
- func NewDefaultPrinter(w io.Writer) *defaultPrinter
- func NewJSONPrinter(w io.Writer) *jsonPrinter
- func NewLogPrinter(w io.Writer) *logPrinter
- func ParseParams(text string) (map[string]interface{}, error)
- type Definition
- type DefinitionLookupFunc
- type Definitions
- type Env
- type Errors
- type LookupGraphFunc
- type Mode
- type ParamIsSetValidator
- type Printer
- type Template
- func (s *Template) CmdNodesReverseIterator() (nodes []*ast.CommandNode)
- func (s *Template) CommandNodesIterator() (nodes []*ast.CommandNode)
- func (s *Template) DryRun(d driver.Driver) error
- func (t *Template) HasErrors() bool
- func (te *Template) Revert() (*Template, error)
- func (s *Template) Run(d driver.Driver) (*Template, error)
- func (t *Template) UniqueDefinitions(fn DefinitionLookupFunc) (definitions Definitions)
- func (s *Template) Validate(rules ...Validator) (all []error)
- type TemplateExecution
- type UniqueNameValidator
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LenientCompileMode = []compileFunc{ resolveAgainstDefinitions, checkReferencesDeclaration, resolveHolesPass, resolveMissingHolesPass, replaceVariableValuePass, removeValueStatementsPass, resolveAliasPass, } NormalCompileMode = append( LenientCompileMode, failOnUnresolvedHoles, failOnUnresolvedAlias, ) )
Functions ¶
func IsRevertible ¶
func MatchStringParamValue ¶ added in v0.0.22
func NewDefaultPrinter ¶ added in v0.0.20
func NewJSONPrinter ¶ added in v0.0.25
func NewLogPrinter ¶ added in v0.0.20
func ParseParams ¶
Types ¶
type Definition ¶ added in v0.0.21
func (Definition) Extra ¶ added in v0.0.21
func (def Definition) Extra() []string
func (Definition) GetTemplate ¶ added in v0.0.21
func (def Definition) GetTemplate() (*Template, error)
func (Definition) Name ¶ added in v0.0.21
func (def Definition) Name() string
func (Definition) Required ¶ added in v0.0.21
func (def Definition) Required() []string
func (Definition) String ¶ added in v0.0.21
func (def Definition) String() string
type DefinitionLookupFunc ¶ added in v0.0.21
type DefinitionLookupFunc func(key string) (Definition, bool)
type Definitions ¶ added in v0.0.21
type Definitions []Definition
func (Definitions) Map ¶ added in v0.0.21
func (defs Definitions) Map(fn func(Definition) string) (reduced []string)
type Env ¶
type Env struct { Fillers map[string]interface{} DefLookupFunc DefinitionLookupFunc AliasFunc func(entity, key, alias string) string MissingHolesFunc func(string) interface{} Log *logger.Logger // contains filtered or unexported fields }
func (*Env) AddFillers ¶
func (*Env) GetProcessedFillers ¶ added in v0.0.25
type ParamIsSetValidator ¶ added in v0.0.22
type ParamIsSetValidator struct {
Entity, Action, Param, WarningMessage string
}
func (*ParamIsSetValidator) Execute ¶ added in v0.0.22
func (v *ParamIsSetValidator) Execute(t *Template) (errs []error)
type Printer ¶
type Printer interface {
Print(*TemplateExecution) error
}
type Template ¶
func (*Template) CmdNodesReverseIterator ¶
func (s *Template) CmdNodesReverseIterator() (nodes []*ast.CommandNode)
func (*Template) CommandNodesIterator ¶
func (s *Template) CommandNodesIterator() (nodes []*ast.CommandNode)
func (*Template) UniqueDefinitions ¶ added in v0.0.21
func (t *Template) UniqueDefinitions(fn DefinitionLookupFunc) (definitions Definitions)
type TemplateExecution ¶ added in v0.0.25
type TemplateExecution struct { *Template Author, Source, Locale string Fillers map[string]interface{} }
Allow template executions serialization with context for JSON storage without altering the template.Template model
func (*TemplateExecution) MarshalJSON ¶ added in v0.0.25
func (t *TemplateExecution) MarshalJSON() ([]byte, error)
func (*TemplateExecution) UnmarshalJSON ¶ added in v0.0.25
func (t *TemplateExecution) UnmarshalJSON(b []byte) error
type UniqueNameValidator ¶
type UniqueNameValidator struct {
LookupGraph LookupGraphFunc
}
func (*UniqueNameValidator) Execute ¶
func (v *UniqueNameValidator) Execute(t *Template) (errs []error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.