store

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: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAttribute

func GetAttribute(c Cursor, space, local string) (node.Attribute, bool)

A convenience method for retrieving a node.Attribute.

Types

type Cursor

type Cursor interface {
	// Pos returns the position of the Node.
	// Implementations MUST store Cursor's in order by the following rules:
	// Positions MUST be unique.
	// The node.Root MUST have a position of 0.
	// Namespaces, Attributes, and Children MUST be in order, from least to greatest.
	// Namespace positions MUST be less than the Attribute and Children positions.
	// Attribute positions MUST be less than Children positions.
	Pos() int
	// Node returns the node.Node stored in this Cursor.
	Node() node.Node
	Namespaces() []Cursor
	Attributes() []Cursor
	Children() []Cursor
	Parent() Cursor
}

Cursor's are used for tracking the position and child-parent relationships of node.Node's.

type InMemory

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

func CreateInMemory

func CreateInMemory(parse parser.Parser) (*InMemory, error)

Gathers and stores node.Node's in memory.

func (*InMemory) Attributes

func (c *InMemory) Attributes() []Cursor

func (*InMemory) Children

func (c *InMemory) Children() []Cursor

func (*InMemory) Namespaces

func (c *InMemory) Namespaces() []Cursor

func (*InMemory) Node

func (c *InMemory) Node() node.Node

func (*InMemory) Parent

func (c *InMemory) Parent() Cursor

func (*InMemory) Pos

func (c *InMemory) Pos() int

Jump to

Keyboard shortcuts

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