template

package
v0.12.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package template provides templating functionality

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Name string
	Text string
}

Item represents a named templated which can reference other named templated too.

type Template

type Template struct {
	// contains filtered or unexported fields
}

Template represents a new Template with given name and content to be rendered with provided settings with use of built-in and custom functions.

func New

func New(settings *print.Settings, items ...*Item) *Template

New returns new instance of Template.

func (Template) CustomFunc

func (t Template) CustomFunc(funcs gotemplate.FuncMap)

CustomFunc adds new custom functions to the template if functions with the same names didn't exist.

func (Template) Funcs

func (t Template) Funcs() gotemplate.FuncMap

Funcs return available template out of the box and custom functions.

func (Template) Render

func (t Template) Render(module *terraform.Module) (string, error)

Render template with given Module struct.

Jump to

Keyboard shortcuts

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