Documentation
¶
Overview ¶
Package generator implements a solution to parse data-driven templates and generate output.
A data-driven template is executed by applying it the data structure provided by the application context.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrbitGenerator ¶
type OrbitGenerator struct {
// contains filtered or unexported fields
}
OrbitGenerator provides a set of functions which help to execute a data-driven template.
func NewOrbitGenerator ¶
func NewOrbitGenerator(context *context.OrbitContext) *OrbitGenerator
NewOrbitGenerator instantiates a new instance of OrbitGenerator.
func (*OrbitGenerator) Parse ¶
func (g *OrbitGenerator) Parse() (bytes.Buffer, error)
Parse executes a data-driven template by applying it the data structure provided by the application context.
Returns the resulting bytes.
func (*OrbitGenerator) WriteOutputFile ¶
func (g *OrbitGenerator) WriteOutputFile(outputPath string, data bytes.Buffer) error
WriteOutputFile writes bytes into a file.
If the file does not exist, this function will create it.
This function should be called after Parse function.