generator

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {

	// GetTemplates gets a map of the templates currently
	// available to the generator.
	//
	// Returns a map of the template properties and an error object
	GetTemplates() (map[string]*tmpl.Properties, error)

	// OverridesPath sets the path to use for template files that can override
	// files in the template being generated.
	//
	// Returns the Generator so it can be chained.
	OverridesPath(string) Generator

	// DestinationPath sets the path that will be used for the output of
	// the generated template.
	//
	// Returns the Generator so it can be chained.
	DestinationPath(string) Generator

	// PathPrefix sets the prefix to use for the path to the
	// embedded template folder
	//
	// Returns the Generator so it can be chained.
	PathPrefix(string) Generator

	// CleanDestination tells the generator whether or not to wipe the destination
	// before generating the template. Default is false.
	//
	// Returns the Generator so it can be chained.
	CleanDestination(bool) Generator

	// Generate processes the template and override files and generates the result
	// to the defined destination path.
	Generate(interface{}, *tmpl.Overrides) error
}

func LoadFromPackr

func LoadFromPackr(box *packr.Box) Generator

func LoadFromPath

func LoadFromPath(path string) Generator

Jump to

Keyboard shortcuts

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