template

package
v0.0.0-...-dc23247 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseStatement

func ParseStatement(text string) (ast.Node, error)

Types

type CollectDefinitions

type CollectDefinitions struct {
	C []TemplateDefinition
	L LookupTemplateDefFunc
}

func (*CollectDefinitions) Visit

func (t *CollectDefinitions) Visit(sts []*ast.Statement) error

type ExecutedStatement

type ExecutedStatement struct {
	Line, Err, Result string
}

func (*ExecutedStatement) IsRevertible

func (ex *ExecutedStatement) IsRevertible() bool

type LookupTemplateDefFunc

type LookupTemplateDefFunc func(key string) (TemplateDefinition, bool)

type Template

type Template struct {
	*ast.AST
}

func MustParse

func MustParse(text string) *Template

func Parse

func Parse(text string) (*Template, error)

func (*Template) Compile

func (s *Template) Compile(d driver.Driver) (*Template, error)

func (*Template) GetHolesValuesSet

func (s *Template) GetHolesValuesSet() (values []string)

func (*Template) GetNormalizedAliases

func (s *Template) GetNormalizedAliases() map[string]string

func (*Template) GetNormalizedParams

func (s *Template) GetNormalizedParams() map[string]interface{}

func (*Template) MergeParams

func (s *Template) MergeParams(newParams map[string]interface{})

func (*Template) ResolveHoles

func (s *Template) ResolveHoles(refs ...map[string]interface{}) (map[string]interface{}, error)

func (*Template) Run

func (s *Template) Run(d driver.Driver) (*Template, error)

func (*Template) Visit

func (t *Template) Visit(v Visitor) error

type TemplateDefinition

type TemplateDefinition struct {
	Action, Entity, Api                      string
	RequiredParams, ExtraParams, TagsMapping []string
}

func (TemplateDefinition) Extra

func (def TemplateDefinition) Extra() []string

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 TemplateExecution

type TemplateExecution struct {
	ID       string
	Executed []*ExecutedStatement
}

func NewTemplateExecution

func NewTemplateExecution(tpl *Template) *TemplateExecution

func (*TemplateExecution) HasErrors

func (te *TemplateExecution) HasErrors() (inError bool)

func (*TemplateExecution) IsRevertible

func (te *TemplateExecution) IsRevertible() bool

func (*TemplateExecution) Revert

func (te *TemplateExecution) Revert() (*Template, error)

type Visitor

type Visitor interface {
	Visit([]*ast.Statement) error
}

Directories

Path Synopsis
aws
DO NOT EDIT This file was automatically generated with go generate DO NOT EDIT This file was automatically generated with go generate
DO NOT EDIT This file was automatically generated with go generate DO NOT EDIT This file was automatically generated with go generate

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL