xml2map

package
v0.0.0-...-60192f8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package xml2map provides an XML decoder returning a map of properties parsed from a given XML input.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidDocument invalid document err.
	ErrInvalidDocument = errors.New("invalid document")

	// ErrInvalidRoot data at the root level is invalid err.
	ErrInvalidRoot = errors.New("data at the root level is invalid")
)

Functions

This section is empty.

Types

type Decoder

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

Decoder instance.

func NewDecoder

func NewDecoder(reader io.Reader) *Decoder

NewDecoder create new decoder instance.

func NewDecoderWithPrefix

func NewDecoderWithPrefix(reader io.Reader, attrPrefix, textPrefix string) *Decoder

NewDecoderWithPrefix create new decoder instance with custom attribute prefix and text prefix.

func (*Decoder) Decode

func (d *Decoder) Decode() (map[string]any, error)

Decode xml string to map[string]any.

Jump to

Keyboard shortcuts

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