transmog

package module
v0.0.0-...-9df150c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 10 Imported by: 0

README

transmog alt text

Transmogrify JSON, YAML and XML.

Uses https://github.com/clbanning/mxj to marshal and unmarshal XML into memory and https://github.com/ghodss/yaml to marshal and unmarshal YAML and JSON.

Load some data, update it and write it out in whatever format needed.

'it took me all morning'

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transmog

type Transmog struct {
	// contains filtered or unexported fields
}

Transmog represents an instance of data that can be transmogrified.

func (*Transmog) Get

func (t *Transmog) Get(path []string) (string, error)

Get value from data give path string.

func (*Transmog) LoadFile

func (t *Transmog) LoadFile(path string) error

LoadFile a JSON, YAML or XML file.

func (*Transmog) Parse

func (t *Transmog) Parse(data []byte) error

Parse a JSON or YAML slice.

func (*Transmog) ParseXML

func (t *Transmog) ParseXML(data []byte) error

ParseXML will parse an XML slice.

func (*Transmog) Set

func (t *Transmog) Set(path []string, value string) error

Set value in data found at path string.

func (*Transmog) ToJSON

func (t *Transmog) ToJSON() ([]byte, error)

ToJSON transmogrify data to JSON.

func (*Transmog) ToXML

func (t *Transmog) ToXML(indent string) ([]byte, error)

ToXML transmogrify data to XML.

func (*Transmog) ToYaml

func (t *Transmog) ToYaml() ([]byte, error)

ToYaml transmogrify data to YAML.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL