renderer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RenderEnv

type RenderEnv struct {
	Renderer
}

RenderEnv renders using environment variables

func (*RenderEnv) File2File

func (r *RenderEnv) File2File(src, dst string, vars *variables.Variables, nounset, noempty bool) (err error)

File2File takes a src file populates a dst file with the results of the template populated with variables

func (*RenderEnv) RenderDirRegexp

func (r *RenderEnv) RenderDirRegexp() *regexp.Regexp

RenderDirRegexp returns the regex to match directory names that should be rendered.

func (*RenderEnv) Text2File

func (r *RenderEnv) Text2File(text, dst string, vars *variables.Variables, nounset, noempty bool) (err error)

Text2File takes template text text and outputs to dst file

func (*RenderEnv) Text2String

func (r *RenderEnv) Text2String(text string, vars *variables.Variables, nounset, noempty bool) (result string, err error)

Text2String renders input text and returns result as a string.

type RenderText

type RenderText struct {
	Renderer
}

RenderText render using text/template

func (*RenderText) File2File

func (r *RenderText) File2File(src, dst string, vars *variables.Variables, nounset, noempty bool) error

File2File takes a src file populates a dst file with the results of the template populated with variables

func (*RenderText) RenderDirRegexp

func (r *RenderText) RenderDirRegexp() *regexp.Regexp

RenderDirRegexp returns the regex to match directory names that should be rendered.

func (*RenderText) Text2File

func (r *RenderText) Text2File(text, dst string, vars *variables.Variables, nounset, noempty bool) error

Text2File takes template text text and outputs to dst file

func (*RenderText) Text2String

func (r *RenderText) Text2String(text string, vars *variables.Variables, nounset, noempty bool) (string, error)

Text2String renders input text and returns result as a string.

type Renderer

type Renderer interface {
	File2File(src, dst string, vars *variables.Variables, nounset, noempty bool) error
	Text2File(text, dst string, vars *variables.Variables, nounset, noempty bool) error
	Text2String(text string, vars *variables.Variables, nounset, noempty bool) (string, error)
	RenderDirRegexp() *regexp.Regexp
}

Renderer is an interface to render templates.

Jump to

Keyboard shortcuts

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