Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromJSON ¶
FromJSON converts a JSON document into a map[string]interface{}.
This is not a general-purpose JSON parser, and will not parse all valid JSON documents. Additionally, because its intended use is within templates it tolerates errors. It will insert the returned error message string into m["Error"] in the returned map.
func FromJSONArray ¶
func FromJSONArray(str string) []interface{}
FromJSONArray converts a JSON array into a []interface{}.
This is not a general-purpose JSON parser, and will not parse all valid JSON documents. Additionally, because its intended use is within templates it tolerates errors. It will insert the returned error message string as the first and only item in the returned array.
func FromYAML ¶
FromYAML converts a YAML document into a map[string]interface{}.
This is not a general-purpose YAML parser, and will not parse all valid YAML documents. Additionally, because its intended use is within templates it tolerates errors. It will insert the returned error message string into m["Error"] in the returned map.
func FromYAMLArray ¶
func FromYAMLArray(str string) []interface{}
FromYAMLArray converts a YAML array into a []interface{}.
This is not a general-purpose YAML parser, and will not parse all valid YAML documents. Additionally, because its intended use is within templates it tolerates errors. It will insert the returned error message string as the first and only item in the returned array.
func ToJSON ¶
func ToJSON(v interface{}) string
ToJSON takes an interface, marshals it to json, and returns a string. It will always return a string, even on marshal error (empty string).
This is designed to be called from a template.
Types ¶
This section is empty.