xml

package
v2.0.0-preview.4+incom... Latest Latest
Warning

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

Go to latest
Published: May 26, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

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

An Encoder provides encoding of the AWS XML protocol. This encoder will will write all content to XML. Only supports body and payload targets.

func NewEncoder

func NewEncoder() *Encoder

NewEncoder creates a new encoder for encoding AWS XML protocol. Only encodes fields into the XML body, and error is returned if target is anything other than Body or Payload.

func (*Encoder) Encode

func (e *Encoder) Encode() (io.ReadSeeker, error)

Encode returns the encoded XMl reader. An error will be returned if one was encountered while building the XML body.

func (*Encoder) List

List creates an XML list and calls the passed in fn callback with a list encoder.

func (*Encoder) Map

Map creates an XML map and calls the passed in fn callback with a map encoder.

func (*Encoder) SetFields

func (e *Encoder) SetFields(t protocol.Target, k string, m protocol.FieldMarshaler, meta protocol.Metadata)

SetFields sets the nested fields to the XML body.

func (*Encoder) SetStream

func (e *Encoder) SetStream(t protocol.Target, k string, v protocol.StreamMarshaler, meta protocol.Metadata)

SetStream is not supported for XML protocol marshaling.

func (*Encoder) SetValue

SetValue sets an individual value to the XML body.

type ListEncoder

type ListEncoder struct {
	Base     *Encoder
	Key      string
	Metadata protocol.Metadata
	Token    xml.StartElement
	// contains filtered or unexported fields
}

A ListEncoder encodes elements within a list for the XML encoder.

func (*ListEncoder) End

func (e *ListEncoder) End()

End will write the end element if the list is not flat.

func (*ListEncoder) List

func (e *ListEncoder) List() protocol.ListEncoder

List will return an error since nested collections are not support by this protocol.

func (*ListEncoder) ListAddFields

func (e *ListEncoder) ListAddFields(m protocol.FieldMarshaler)

ListAddFields will set the nested type's fields to the list.

func (*ListEncoder) ListAddValue

func (e *ListEncoder) ListAddValue(v protocol.ValueMarshaler)

ListAddValue will add the value to the list.

func (*ListEncoder) Map

func (e *ListEncoder) Map() protocol.MapEncoder

Map will return an error since nested collections are not support by this protocol.

func (*ListEncoder) Start

func (e *ListEncoder) Start()

Start will write the start element and set the token for closing

type MapEncoder

type MapEncoder struct {
	Base      *Encoder
	Flatten   bool
	Key       string
	KeyName   string
	ValueName string

	Token    xml.StartElement
	Metadata protocol.Metadata
	// contains filtered or unexported fields
}

A MapEncoder encodes key values pair map values for the XML encoder.

func (*MapEncoder) End

func (e *MapEncoder) End()

End will close the associated tag.

func (*MapEncoder) List

List will set err as nested collections are not supported in this protocol.

func (*MapEncoder) Map

Map will set err as nested collections are not supported in this protocol.

func (*MapEncoder) MapSetFields

func (e *MapEncoder) MapSetFields(k string, m protocol.FieldMarshaler)

MapSetFields will set the nested type's fields under the map.

func (*MapEncoder) MapSetList

func (e *MapEncoder) MapSetList(k string, fn func(le protocol.ListEncoder))

MapSetList is not supported.

func (*MapEncoder) MapSetMap

func (e *MapEncoder) MapSetMap(k string, fn func(me protocol.MapEncoder))

MapSetMap is not supported.

func (*MapEncoder) MapSetValue

func (e *MapEncoder) MapSetValue(k string, v protocol.ValueMarshaler)

MapSetValue sets a map value.

func (*MapEncoder) Start

func (e *MapEncoder) Start()

Start will open a new scope by creating a new XML start element tag.

Directories

Path Synopsis
Package xmlutil provides XML serialization of AWS requests and responses.
Package xmlutil provides XML serialization of AWS requests and responses.

Jump to

Keyboard shortcuts

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