minidom

package
v0.0.0-...-4c6a4f5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QuitAt

func QuitAt(stop string) func(xml.EndElement) bool

QuitAt is a default implementation for EndFunc

Types

type EachDOM

type EachDOM func(io.ReadCloser, error) error

EachDOM provides a walking function for a substream

type Flatten

type Flatten struct {
	Prefix     string
	Repeatable []string
	OmitPrefix bool
}

Flatten ...

func (Flatten) Map

func (f Flatten) Map(parser *xml.Decoder) (map[string]string, error)

Map ...

type Matcher

type Matcher func(xml.StartElement) bool

Matcher provides a swappable matcher for finding elems

func ByName

func ByName(match string) Matcher

ByName is the simple default for matching

type MiniDom

type MiniDom struct {
	// StartFunc listens to start elems outside of Prefix
	StartFunc func(xml.StartElement)
	// EndFunc listens to the end elems outside of Prefix, bool returns whether an exit is requested
	EndFunc func(xml.EndElement) bool
}

MiniDom provides the lifecycle management for walking streams of doms

func (MiniDom) Walk

func (md MiniDom) Walk(parser *xml.Decoder, match Matcher, each EachDOM) error

Walk finds the next <prefix> and produces an io.ReadCloser of the <prefix>...</prefix> sub elem

type XPath

type XPath []string

XPath provides helpers for a path

func (XPath) Index

func (xp XPath) Index(counts map[string]int) string

Index creates indexes a known path given count state

func (XPath) String

func (xp XPath) String() string

String is the default string view

Jump to

Keyboard shortcuts

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