templates

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Config name of template from file config.tmpl
	Config = "config.tmpl"
	// Controller name of template from file controller.tmpl
	Controller = "controller.tmpl"
	// Docs name of template from file docs.tmpl
	Docs = "docs.tmpl"
	// Gitignore name of template from file gitignore.tmpl
	Gitignore = "gitignore.tmpl"
	// Main name of template from file main.tmpl
	Main = "main.tmpl"
	// Models name of template from file models.tmpl
	Models = "models.tmpl"
	// TestConfig name of template from file test_config.tmpl
	TestConfig = "test_config.tmpl"
)

Variables

View Source
var (
	// ConfigTemplate from file config.tmpl
	ConfigTemplate = &Template{Name: Config}
	// ControllerTemplate from file controller.tmpl
	ControllerTemplate = &Template{Name: Controller}
	// DocsTemplate from file docs.tmpl
	DocsTemplate = &Template{Name: Docs}
	// GitignoreTemplate from file gitignore.tmpl
	GitignoreTemplate = &Template{Name: Gitignore}
	// MainTemplate from file main.tmpl
	MainTemplate = &Template{Name: Main}
	// ModelsTemplate from file models.tmpl
	ModelsTemplate = &Template{Name: Models}
	// TestConfigTemplate from file test_config.tmpl
	TestConfigTemplate = &Template{Name: TestConfig}
)

Functions

func GetTemplates

func GetTemplates() *template.Template

GetTemplates returns a template that has the all the other templates parsed into it accessible via their filename.

Types

type Template

type Template struct {
	// Name of the template within the template collection.
	Name string
}

Template for creating a structured file given a context and a path.

func (*Template) Execute

func (t *Template) Execute(context interface{}, fileMode os.FileMode, outputPath ...string) error

Execute this template writing the output data to the passed outputPath which will be joined using path.

func (*Template) GetName

func (t *Template) GetName() string

GetName of this template

Jump to

Keyboard shortcuts

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