template

package
v0.0.0-...-73b76a0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(options *Options)

func FuncMap

func FuncMap(funcMap template.FuncMap) Option

func GoSource

func GoSource(isGoSource bool) Option

func Name

func Name(name string) Option

func Path

func Path(templatePath string) Option

Path sets the path to the source template file. The path is either relative to the user's CWD or, if an external http.Filesystem is provided, relative to that filesystem.

func UseFilesystem

func UseFilesystem(fs http.FileSystem) Option

type Options

type Options struct {
	Name       string
	Path       string
	GoSource   bool
	FuncMap    template.FuncMap
	Filesystem http.FileSystem
}

type Template

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

func NewTemplate

func NewTemplate(options ...Option) *Template

func (*Template) Render

func (tpl *Template) Render(templateContext interface{}) ([]byte, error)

func (*Template) SourceFileExists

func (tpl *Template) SourceFileExists() bool

SourceFileExists returns 'true' if the source template file exists

Jump to

Keyboard shortcuts

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