xml

package
v2.1.1-0...-182a82a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

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

Array represents an array of values/references.

func NewArray

func NewArray(name, path string, template specs.Template, store references.Store, tracker references.Tracker) *Array

NewArray constructs a new XML array encoder/decoder.

func (*Array) MarshalXML

func (array *Array) MarshalXML(encoder *xml.Encoder, _ xml.StartElement) error

MarshalXML encodes the given specs object into the provided XML encoder.

func (*Array) UnmarshalXML

func (array *Array) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error

UnmarshalXML decodes XML input into the receiver of type specs.Repeated.

type Constructor

type Constructor struct{}

Constructor is capable of constructing new codec managers for the given resource and specs.

func NewConstructor

func NewConstructor() *Constructor

NewConstructor constructs a new XML constructor.

func (*Constructor) Name

func (constructor *Constructor) Name() string

Name returns the name of the XML codec constructor.

func (*Constructor) New

func (constructor *Constructor) New(resource string, specs *specs.ParameterMap) (codec.Manager, error)

New constructs a new XML codec manager

type Enum

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

Enum is a vrapper over specs.Enum providing XML encoding/decoding.

func NewEnum

func NewEnum(name, path string, template specs.Template, store references.Store, tracker references.Tracker) *Enum

NewEnum creates a new enum by wrapping provided specs.Enum.

func (*Enum) MarshalXML

func (enum *Enum) MarshalXML(encoder *xml.Encoder, _ xml.StartElement) error

MarshalXML marshals given enum to XML.

func (*Enum) UnmarshalXML

func (enum *Enum) UnmarshalXML(decoder *xml.Decoder, _ xml.StartElement) error

UnmarshalXML unmarshals enum value from XML stream.

type Manager

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

Manager manages a specs object and allows to encode/decode messages.

func (*Manager) Marshal

func (manager *Manager) Marshal(refs references.Store) (io.Reader, error)

Marshal marshals the given reference store into a XML message. This method is called during runtime to encode a new message with the values stored inside the given reference store.

func (*Manager) Name

func (manager *Manager) Name() string

Name returns the codec name.

func (*Manager) Property

func (manager *Manager) Property() *specs.Property

Property returns the manager property which is used to marshal and unmarshal data.

func (*Manager) Unmarshal

func (manager *Manager) Unmarshal(reader io.Reader, refs references.Store) error

Unmarshal unmarshals the given XML io.Reader into the given reference store. This method is called during runtime to decode a new message and store it inside the given reference store.

type Object

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

Object represents an XML object.

func NewObject

func NewObject(name, path string, template specs.Template, store references.Store, tracker references.Tracker) *Object

NewObject creates a new object by wrapping provided specs.Message.

func (*Object) MarshalXML

func (object *Object) MarshalXML(encoder *xml.Encoder, _ xml.StartElement) error

MarshalXML encodes the given specs object into the given XML encoder.

func (*Object) UnmarshalXML

func (object *Object) UnmarshalXML(decoder *xml.Decoder, _ xml.StartElement) error

UnmarshalXML decodes XML input into the receiver of type specs.Message.

type Scalar

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

Scalar is a wrapper for specs.Scalar providing XML encoding/decoding.

func NewScalar

func NewScalar(name, path string, template specs.Template, store references.Store, tracker references.Tracker) *Scalar

NewScalar creates a wrapper for specs.Scalar to be XML encoded/decoded.

func (Scalar) MarshalXML

func (scalar Scalar) MarshalXML(encoder *xml.Encoder, _ xml.StartElement) error

MarshalXML marshals scalar value to XML.

func (*Scalar) UnmarshalXML

func (scalar *Scalar) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error

UnmarshalXML unmarshals scalar value from XML stream.

Jump to

Keyboard shortcuts

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