Documentation ¶
Index ¶
- func Compile(tpl *Template, env *Env) (*Template, *Env, error)
- func IsRevertible(t *Template) bool
- func NewDefaultPrinter(w io.Writer) *defaultPrinter
- func NewLogPrinter(w io.Writer) *logPrinter
- func ParseParams(text string) (map[string]interface{}, error)
- type CollectDefinitions
- type Env
- type LookupGraphFunc
- type LookupTemplateDefFunc
- type Printer
- type Template
- func (s *Template) CmdNodesReverseIterator() (nodes []*ast.CommandNode)
- func (s *Template) CommandNodesIterator() (nodes []*ast.CommandNode)
- func (s *Template) Compile(d driver.Driver) (*Template, error)
- func (t *Template) HasErrors() bool
- func (s *Template) IsSameAs(t2 *Template) bool
- func (t *Template) MarshalJSON() ([]byte, error)
- func (te *Template) Revert() (*Template, error)
- func (s *Template) Run(d driver.Driver) (*Template, error)
- func (t *Template) UnmarshalJSON(b []byte) error
- func (s *Template) Validate(rules ...Validator) (all []error)
- func (s *Template) Visit(v Visitor) error
- type TemplateDefinition
- type UniqueNameValidator
- type Validator
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRevertible ¶
func NewDefaultPrinter ¶ added in v0.0.20
func NewLogPrinter ¶ added in v0.0.20
func ParseParams ¶
Types ¶
type CollectDefinitions ¶
type CollectDefinitions struct { C []TemplateDefinition L LookupTemplateDefFunc }
func (*CollectDefinitions) Visit ¶
func (t *CollectDefinitions) Visit(cmds []*ast.CommandNode) error
type Env ¶
type Env struct { Fillers map[string]interface{} Resolved map[string]interface{} DefLookupFunc LookupTemplateDefFunc AliasFunc func(entity, key, alias string) string MissingHolesFunc func(string) interface{} Log *logger.Logger }
func (*Env) AddFillers ¶
type LookupTemplateDefFunc ¶
type LookupTemplateDefFunc func(key string) (TemplateDefinition, bool)
type Template ¶
func (*Template) CmdNodesReverseIterator ¶
func (s *Template) CmdNodesReverseIterator() (nodes []*ast.CommandNode)
func (*Template) CommandNodesIterator ¶
func (s *Template) CommandNodesIterator() (nodes []*ast.CommandNode)
func (*Template) MarshalJSON ¶
func (*Template) UnmarshalJSON ¶
type TemplateDefinition ¶
func (TemplateDefinition) Extra ¶
func (def TemplateDefinition) Extra() []string
func (TemplateDefinition) GetTemplate ¶
func (def TemplateDefinition) GetTemplate() (*Template, error)
func (TemplateDefinition) Name ¶
func (def TemplateDefinition) Name() string
func (TemplateDefinition) Required ¶
func (def TemplateDefinition) Required() []string
func (TemplateDefinition) String ¶
func (def TemplateDefinition) String() string
type UniqueNameValidator ¶
type UniqueNameValidator struct {
LookupGraph LookupGraphFunc
}
func (*UniqueNameValidator) Execute ¶
func (v *UniqueNameValidator) Execute(t *Template) (errs []error)
type Visitor ¶
type Visitor interface {
Visit([]*ast.CommandNode) error
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.