Documentation ¶
Overview ¶
Package template renders the static files under the "/templates/" directory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
Content represents the parsed template.
func (*Content) MarshalBinary ¶
MarshalBinary returns the contents as binary and implements the encoding.BinaryMarshaler interface.
type ParseOption ¶
ParseOption represents a functional option for the Parse method.
func WithFuncs ¶
func WithFuncs(fns map[string]interface{}) ParseOption
WithFuncs returns a template that can parse additional custom functions.
type Parser ¶
type Parser interface {
Parse(path string, data interface{}, options ...ParseOption) (*Content, error)
}
Parser is the interface that wraps the Parse method.
type ReadParser ¶
ReadParser is the interface that wraps the Read and Parse methods.
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template represents the "/templates/" directory that holds static files to be embedded in the binary.
func New ¶
func New() *Template
New returns a Template object that can be used to parse files under the "/templates/" directory.