xmlutil

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package xmlutil provides XML serialisation of AWS requests and responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildXML

func BuildXML(params interface{}, e *xml.Encoder) error

BuildXML will serialize params into an xml.Encoder. Error will be returned if the serialization of any of the params or nested values fails.

func StructToXML

func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error

StructToXML writes an XMLNode to a xml.Encoder as tokens.

func UnmarshalXML

func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error

UnmarshalXML deserializes an xml.Decoder into the container v. V needs to match the shape of the XML expected to be decoded. If the shape doesn't match unmarshaling will fail.

Types

type XMLNode

type XMLNode struct {
	Name     xml.Name              `json:",omitempty"`
	Children map[string][]*XMLNode `json:",omitempty"`
	Text     string                `json:",omitempty"`
	Attr     []xml.Attr            `json:",omitempty"`
}

A XMLNode contains the values to be encoded or decoded.

func NewXMLElement

func NewXMLElement(name xml.Name) *XMLNode

NewXMLElement returns a pointer to a new XMLNode initialized to default values.

func XMLToStruct

func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error)

XMLToStruct converts a xml.Decoder stream to XMLNode with nested values.

func (*XMLNode) AddChild

func (n *XMLNode) AddChild(child *XMLNode)

AddChild adds child to the XMLNode.

Jump to

Keyboard shortcuts

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