Documentation ¶
Index ¶
- func GetFuncs() []string
- func MustProcessTemplateFile(template string, bundle interface{}) string
- func MustTemplate(str string, data interface{}) string
- func ProcessTemplateFile(template string, bundle interface{}) ([]byte, error)
- func RegisterFS(filesystem afero.Fs)
- func RegisterFunc(key string, templatefunc interface{})
- func Template(str string, data interface{}) (string, error)
- func TemplateDelim(str string, data interface{}, begin, end string) (string, error)
- type Parser
- type ParserFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFuncs ¶
func GetFuncs() []string
GetFuncs will return all usable template funcs as string slice
func MustProcessTemplateFile ¶
MustProcessTemplateFile processes golang template file otherwise panics
func MustTemplate ¶
MustTemplate parses string as Go template, using data as scope
func ProcessTemplateFile ¶
ProcessTemplateFile processes golang template file
func RegisterFS ¶
RegisterFS (afero) virtual filesystem for ProcessTemplateFile
func RegisterFunc ¶
func RegisterFunc(key string, templatefunc interface{})
RegisterFunc registers a new template func to the template parser
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is the main type
func (*Parser) ParseStruct ¶
ParseStruct parses byte slice into map or slice
func (*Parser) ReadStruct ¶
ReadStruct reads from given file, parsing into structure
func (*Parser) RegisterParser ¶
func (l *Parser) RegisterParser(format string, parser ParserFunc)
RegisterParser registers or overrides a format parser func. Indices are lower case.
type ParserFunc ¶
ParserFunc is to parse a []byte into an interface{}
Click to show internal directories.
Click to hide internal directories.