Documentation ¶
Index ¶
- Variables
- func IsRevertible(t *Template) bool
- func MatchStringParamValue(s string) bool
- func NewEnv() *envBuilder
- func NewRunEnv(cenv env.Compiling, context ...map[string]interface{}) env.Running
- func ParseParams(text string) (map[string]interface{}, error)
- type Errors
- type LookupGraphFunc
- type Mode
- type ParamIsSetValidator
- type Runner
- type Template
- func (s *Template) CommandNodesIterator() (nodes []*ast.CommandNode)
- func (s *Template) CommandNodesReverseIterator() (nodes []*ast.CommandNode)
- func (s *Template) DryRun(renv env.Running) (tpl *Template, err error)
- func (t *Template) HasErrors() bool
- func (temp *Template) Revert() (*Template, error)
- func (s *Template) Run(renv env.Running) (*Template, error)
- func (t *Template) UniqueDefinitions(apis map[string]string) (res []string)
- func (s *Template) Validate(rules ...Validator) (all []error)
- type TemplateExecution
- func (t *TemplateExecution) Date() time.Time
- func (t *TemplateExecution) IsOneLiner() bool
- func (t *TemplateExecution) MarshalJSON() ([]byte, error)
- func (t *TemplateExecution) SetMessage(s string)
- func (t *TemplateExecution) Stats() *TemplateExecutionStats
- func (t *TemplateExecution) UnmarshalJSON(b []byte) error
- type TemplateExecutionStats
- type UniqueNameValidator
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TestCompileMode = []compileFunc{ injectCommandsInNodesPass, failOnDeclarationWithNoResultPass, processAndValidateParamsPass, checkInvalidReferenceDeclarationsPass, resolveHolesPass, resolveMissingHolesPass, removeOptionalHolesPass, resolveAliasPass, inlineVariableValuePass, resolveParamsAndExtractRefsPass, } PreRevertCompileMode = []compileFunc{ resolveParamsAndExtractRefsPass, } NewRunnerCompileMode = []compileFunc{ injectCommandsInNodesPass, failOnDeclarationWithNoResultPass, processAndValidateParamsPass, checkInvalidReferenceDeclarationsPass, resolveHolesPass, resolveMissingHolesPass, removeOptionalHolesPass, resolveAliasPass, inlineVariableValuePass, failOnUnresolvedHolesPass, failOnUnresolvedAliasPass, resolveParamsAndExtractRefsPass, convertParamsPass, validateCommandsPass, } )
Functions ¶
func IsRevertible ¶
func MatchStringParamValue ¶ added in v0.0.22
func ParseParams ¶
Types ¶
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 Runner ¶ added in v0.1.6
type Runner struct { Template *Template Locale, Profile, Message, TemplatePath string Log *logger.Logger Fillers []map[string]interface{} AliasFunc func(paramPath, alias string) string MissingHolesFunc func(string, []string, bool) string CmdLookuper func(tokens ...string) interface{} Validators []Validator ParamsSuggested int BeforeRun func(*TemplateExecution) (bool, error) AfterRun func(*TemplateExecution) error }
type Template ¶
func (*Template) CommandNodesIterator ¶
func (s *Template) CommandNodesIterator() (nodes []*ast.CommandNode)
func (*Template) CommandNodesReverseIterator ¶ added in v0.1.3
func (s *Template) CommandNodesReverseIterator() (nodes []*ast.CommandNode)
func (*Template) UniqueDefinitions ¶ added in v0.0.21
type TemplateExecution ¶ added in v0.0.25
type TemplateExecution struct { *Template Author, Source, Locale string Profile, Path, Message string Fillers map[string]interface{} }
Allow template executions serialization with context for JSON storage without altering the template.Template model
func (*TemplateExecution) Date ¶ added in v0.1.5
func (t *TemplateExecution) Date() time.Time
Date extract the date from the ulid template identifier
func (*TemplateExecution) IsOneLiner ¶ added in v0.1.5
func (t *TemplateExecution) IsOneLiner() bool
func (*TemplateExecution) MarshalJSON ¶ added in v0.0.25
func (t *TemplateExecution) MarshalJSON() ([]byte, error)
func (*TemplateExecution) SetMessage ¶ added in v0.1.5
func (t *TemplateExecution) SetMessage(s string)
SetMessage set the value of Message, truncating it if exceeds max len
func (*TemplateExecution) Stats ¶ added in v0.1.5
func (t *TemplateExecution) Stats() *TemplateExecutionStats
func (*TemplateExecution) UnmarshalJSON ¶ added in v0.0.25
func (t *TemplateExecution) UnmarshalJSON(b []byte) error
type TemplateExecutionStats ¶ added in v0.1.5
type TemplateExecutionStats struct {
KOCount, OKCount, CmdCount int
ActionEntityCount map[string]int
Oneliner string
}
func (*TemplateExecutionStats) AllKO ¶ added in v0.1.5
func (te *TemplateExecutionStats) AllKO() bool
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.