translate

package
v0.263.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesXMLFromArrai added in v0.238.0

func BytesXMLFromArrai(v rel.Value) (rel.Value, error)

BytesXMLFromArrai converts an Arr.ai object to an XML document in byte resentation

func BytesXMLToArrai added in v0.238.0

func BytesXMLToArrai(bs []byte, config XMLDecodeConfig) (rel.Value, error)

BytesXMLToArrai converts a well formatted XML document in byte representation to a structured Arr.ai object

func BytesYamlToArrai

func BytesYamlToArrai(bytes []byte) (rel.Value, error)

func FromArrai added in v0.173.0

func FromArrai(v rel.Value) (interface{}, error)

FromArrai translates an arrai value to an object suitable for marshalling into json/yaml.

FromArrai translation rules is the reverse of ToArrai.

func ToArrai

func ToArrai(data interface{}) (rel.Value, error)

ToArrai translates an object unmarshalled from json/yaml into an arrai value.

translation follows the rules

object -> {|@,@item|, |key,val|, ...}
array  -> array
null   -> none
other  -> value (bools, numerics, strings)

Types

type XMLDecodeConfig added in v0.238.0

type XMLDecodeConfig struct {
	TrimSurroundingWhitespace bool
}

NOTE: Currently the XML transform does not support documents with explicit namespaces. NOTE: A full cycle from XML -> Arr.ai -> XML reproduces semantically similar documents

with possibly different content.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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