Documentation
¶
Index ¶
- func Deserialize(data *[]byte) (map[string]interface{}, error)
- func DeserializeFile(filename string) (map[string]interface{}, error)
- func MustDeserialize(data *[]byte) map[string]interface{}
- func MustDeserializeFile(filename string) map[string]interface{}
- func MustReadFile(filename string) *[]byte
- func MustSerialize(content map[string]interface{}, asYaml bool) *[]byte
- func MustWriteFile(filename string, content *[]byte)
- func MustWriteSerializedFile(filename string, content map[string]interface{}, asYaml bool)
- func ReadFile(filename string) (*[]byte, error)
- func Serialize(content map[string]interface{}, asYaml bool) (*[]byte, error)
- func WriteFile(filename string, content *[]byte) error
- func WriteSerializedFile(filename string, content map[string]interface{}, asYaml bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶ added in v0.1.8
Deserialize will deserialize data as a JSON or YAML object. Will return an error if deserializing fails or if it isn't an object.
func DeserializeFile ¶ added in v0.1.8
DeserializeFile will read a JSON or YAML file and return the top-level object. Will return an error if it fails reading or the content isn't an object. Reads from stdin if filename == "-".
func MustDeserialize ¶
MustDeserialize will deserialize data as a JSON or YAML object. Will panic if deserializing fails or if it isn't an object. Will never return nil.
func MustDeserializeFile ¶
MustDeserializeFile will read a JSON or YAML file and return the top-level object. Will panic if it fails reading or the content isn't an object. Reads from stdin if filename == "-". This will never return nil.
func MustReadFile ¶
MustReadFile reads file contents. Will panic if reading fails. Reads from stdin if filename == "-"
func MustSerialize ¶
MustSerialize will serialize the result as a JSON/YAML. Will panic if serializing fails.
func MustWriteFile ¶
MustWriteFile writes the output to a file. Will panic if writing fails. Writes to stdout if filename == "-"
func MustWriteSerializedFile ¶
MustWriteSerializedFile will serialize the data and write it to a file. Will panic if it fails. Writes to stdout if filename == "-"
Types ¶
This section is empty.