parser

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HtmlAttribute added in v0.9.8

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

func (HtmlAttribute) AttributeValue added in v0.9.8

func (h HtmlAttribute) AttributeValue() string

func (HtmlAttribute) Local added in v0.9.8

func (h HtmlAttribute) Local() string

func (HtmlAttribute) Space added in v0.9.8

func (h HtmlAttribute) Space() string

type HtmlCharData added in v0.9.8

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

func (HtmlCharData) CharDataValue added in v0.9.8

func (h HtmlCharData) CharDataValue() string

type HtmlComment added in v0.9.8

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

func (HtmlComment) CommentValue added in v0.9.8

func (h HtmlComment) CommentValue() string

type HtmlElement added in v0.9.8

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

func (HtmlElement) Local added in v0.9.8

func (h HtmlElement) Local() string

func (HtmlElement) Space added in v0.9.8

func (h HtmlElement) Space() string

type JsonCharData added in v0.9.8

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

func (JsonCharData) CharDataValue added in v0.9.8

func (j JsonCharData) CharDataValue() string

type JsonElement added in v0.9.8

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

func (JsonElement) Local added in v0.9.8

func (j JsonElement) Local() string

func (JsonElement) Space added in v0.9.8

func (j JsonElement) Space() string

type Parser

type Parser interface {
	Pull() (node.Node, bool, error)
}

Feeds a stream of nodes to be stored in a store.Cursor. Implementations must not emit a node.Root; store.Cursor will create it. For every node.Element emitted, it must be terminated by returning a false value. When emitting a node, it will either be added to the root node, or the last node.Element that was not terminated. node.Namespace's MUST be emitted before node.Attributes. node.Attribute's MUST be emitted before the element's children. When finished emitting nodes, return io.EOF.

func ReadHtml added in v0.9.8

func ReadHtml(in io.Reader) (Parser, error)

Creates a Parser that reads the given HTML document.

func ReadJson added in v0.9.8

func ReadJson(in io.Reader) Parser

Create a Parser that reads the given JSON document.

func ReadXml

func ReadXml(in io.Reader, opts ...XmlParseOptions) Parser

Creates a Parser that reads the given XML document.

type XmlAttribute

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

func (XmlAttribute) AttributeValue

func (x XmlAttribute) AttributeValue() string

func (XmlAttribute) Local

func (x XmlAttribute) Local() string

func (XmlAttribute) Space

func (x XmlAttribute) Space() string

type XmlCharData

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

func (XmlCharData) CharDataValue

func (x XmlCharData) CharDataValue() string

type XmlComment

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

func (XmlComment) CommentValue

func (x XmlComment) CommentValue() string

type XmlElement

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

func (XmlElement) Local

func (x XmlElement) Local() string

func (XmlElement) Space

func (x XmlElement) Space() string

type XmlNamespace

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

func (XmlNamespace) NamespaceValue

func (x XmlNamespace) NamespaceValue() string

func (XmlNamespace) Prefix

func (x XmlNamespace) Prefix() string

type XmlParseOptions added in v0.9.2

type XmlParseOptions func(d *xml.Decoder)

type XmlProcInst

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

func (XmlProcInst) ProcInstValue

func (x XmlProcInst) ProcInstValue() string

func (XmlProcInst) Target

func (x XmlProcInst) Target() string

Jump to

Keyboard shortcuts

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