Documentation
¶
Index ¶
- func FromJSON(o interface{}) (interface{}, error)
- func FromMap(m map[string]interface{}, raw interface{}) error
- func QueryObject(exp string, target interface{}) (interface{}, error)
- func SplitLines(o interface{}) ([]string, error)
- func ToJSON(o interface{}) (string, error)
- func ToMap(raw interface{}) (map[string]interface{}, error)
- func UnixTime() interface{}
- type Options
- type Template
- func (t *Template) AddFunc(name string, f interface{}) *Template
- func (t *Template) DefaultFuncs() map[string]interface{}
- func (t *Template) Execute(output io.Writer, context interface{}) error
- func (t *Template) Render(context interface{}) (string, error)
- func (t *Template) SetOptions(opt Options) *Template
- func (t *Template) Validate() (*Template, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromJSON ¶
func FromJSON(o interface{}) (interface{}, error)
FromJSON decode the input JSON encoded as string or byte slice into a map.
func QueryObject ¶
QueryObject applies a JMESPath query specified by the expression, against the target object.
func SplitLines ¶
SplitLines splits the input into a string slice.
Types ¶
type Options ¶
type Options struct { // SocketDir is the directory for locating the socket file for // a template URL of the form unix://socket_file/path/to/resource SocketDir string }
Options contains parameters for customizing the behavior of the engine
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template is the templating engine
func NewTemplate ¶
NewTemplate fetches the content at the url and returns a template. If the string begins with str:// as scheme, then the rest of the string is interpreted as the body of the template.
func NewTemplateFromBytes ¶
NewTemplateFromBytes builds the template from buffer with a contextURL which is used to deduce absolute path of any 'included' templates e.g. {{ include "./another.tpl" . }}
func (*Template) DefaultFuncs ¶
DefaultFuncs returns a list of default functions for binding in the template
func (*Template) SetOptions ¶
SetOptions sets the runtime flags for the engine