tmpl

package
v0.51.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTextRenderer added in v0.37.0

func NewTextRenderer(readFile func(filename string) ([]byte, error), basePath string, data interface{}) *templateTextRenderer

func RequiredEnv

func RequiredEnv(name string) (string, error)

func ToYaml

func ToYaml(v interface{}) (string, error)

Types

type Context

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

func (*Context) Exec added in v0.30.0

func (c *Context) Exec(command string, args []interface{}, inputs ...string) (string, error)

func (*Context) ReadFile

func (c *Context) ReadFile(filename string) (string, error)

func (*Context) RenderTemplateToBuffer

func (c *Context) RenderTemplateToBuffer(s string, data ...interface{}) (*bytes.Buffer, error)

func (*Context) Tpl added in v0.47.0

func (c *Context) Tpl(text string, data interface{}) (string, error)

type FileRenderer added in v0.25.2

type FileRenderer struct {
	ReadFile func(string) ([]byte, error)
	Context  *Context
	Data     interface{}
}

func NewFileRenderer added in v0.25.2

func NewFileRenderer(readFile func(filename string) ([]byte, error), basePath string, data interface{}) *FileRenderer

func NewFirstPassRenderer added in v0.34.0

func NewFirstPassRenderer(basePath string, data interface{}) *FileRenderer

func (*FileRenderer) RenderTemplateContentToBuffer added in v0.42.0

func (r *FileRenderer) RenderTemplateContentToBuffer(content []byte) (*bytes.Buffer, error)

func (*FileRenderer) RenderTemplateContentToString added in v0.42.0

func (r *FileRenderer) RenderTemplateContentToString(content []byte) (string, error)

func (*FileRenderer) RenderTemplateFileToBuffer added in v0.25.2

func (r *FileRenderer) RenderTemplateFileToBuffer(file string) (*bytes.Buffer, error)

func (*FileRenderer) RenderToBytes added in v0.42.0

func (r *FileRenderer) RenderToBytes(path string) ([]byte, error)

type TextRenderer added in v0.37.0

type TextRenderer interface {
	RenderTemplateText(text string) (string, error)
}

type Values

type Values = map[string]interface{}

func FromYaml

func FromYaml(str string) (Values, error)

func SetValueAtPath

func SetValueAtPath(path string, value interface{}, values Values) (Values, error)

Jump to

Keyboard shortcuts

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