fakexml

package
Version: v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var N = 0

Functions

func Marshal

func Marshal(v types.Type) error

func StructFieldInfo

func StructFieldInfo(f fakereflect.StructField) (*fieldInfo, error)

StructFieldInfo builds and returns a fieldInfo for f.

Types

type Attr

type Attr struct {
	Name  Name
	Value string
}

An Attr represents an attribute in an XML element (Name=Value).

type Encoder

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

func NewEncoder

func NewEncoder() *Encoder

func (*Encoder) Encode

func (enc *Encoder) Encode(v types.Type) error

type Name

type Name struct {
	Space, Local string
}

A Name represents an XML name (Local) annotated with a name space identifier (Space). In tokens returned by Decoder.Token, the Space identifier is given as a canonical URL, not the short prefix used in the document being parsed.

type StartElement

type StartElement struct {
	Name Name
	Attr []Attr
}

A StartElement represents an XML start element.

type TagPathError

type TagPathError struct {
	Struct       fakereflect.TypeAndCanAddr
	Field1, Tag1 string
	Field2, Tag2 string
}

A TagPathError represents an error in the unmarshaling process caused by the use of field tags with conflicting paths.

func (*TagPathError) Error

func (e *TagPathError) Error() string

type UnsupportedTypeError

type UnsupportedTypeError struct {
	Type types.Type
	Path string
}

UnsupportedTypeError is returned when Marshal encounters a type that cannot be converted into XML.

func (*UnsupportedTypeError) Error

func (e *UnsupportedTypeError) Error() string

Jump to

Keyboard shortcuts

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