generator

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

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