generator

package
v3.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package generator implements a solution to parse a data-driven template and generate an output from it.

A data-driven template is executed by applying it the data structure provided by the payload from 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 helps to execute a data-driven template.

func NewOrbitGenerator

func NewOrbitGenerator(context *context.OrbitContext) *OrbitGenerator

NewOrbitGenerator creates an instance of OrbitGenerator.

func (*OrbitGenerator) Execute

func (g *OrbitGenerator) Execute() (bytes.Buffer, error)

Execute executes a data-driven template by applying it the data structure provided by the application context.

Returns the resulting bytes.

func (*OrbitGenerator) Flush

func (g *OrbitGenerator) Flush(outputPath string, data bytes.Buffer) error

Flush writes bytes into a file or to Stdout if no output path given.

This function should be called after Execute function.

Jump to

Keyboard shortcuts

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