elements

package module
v0.0.0-...-69be062 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: Unlicense Imports: 9 Imported by: 0

README

elements

codename: ElementShare

Documentation

Overview

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>

Index

Constants

View Source
const (
	// RootNode is a root node of the XML document or node tree.
	RootNode uint = iota

	// ElementNode is an element, such as <element>.
	ElementNode

	// TextNode is the text content of a node.
	TextNode

	// CommentNode is a comment node, such as <!-- my comment -->
	CommentNode
)

Variables

View Source
var (
	EBadNode  = errors.New("EBadNode")
	EInvalid  = errors.New("EInvalid")
	EOverflow = errors.New("EOverflow")
)

Functions

This section is empty.

Types

type Attr

type Attr struct {
	Name  string
	Value string
	// contains filtered or unexported fields
}

type Node

type Node struct {
	NodeInfo
	Store  *bolt.Bucket
	Parent *Node
	Number uint64
}

func CreateNode

func CreateNode(tx *bolt.Tx, name []byte) (node *Node, err error)

func ToNode

func ToNode(b *bolt.Bucket, parent *Node, num uint64) (node *Node, err error)

func (*Node) AppendAttrib

func (node *Node) AppendAttrib(attr *Attr) error

func (*Node) AppendCurrent

func (n *Node) AppendCurrent(src xpath.NodeNavigator) (err error)

func (*Node) AppendNode

func (node *Node) AppendNode(n *NodeInfo) (*Node, error)

func (*Node) AppendRoot

func (n *Node) AppendRoot(src xpath.NodeNavigator) (err error)

func (*Node) Child

func (node *Node) Child() (*Node, error)

func (*Node) First

func (node *Node) First() (*Node, error)

func (*Node) GetAttrib

func (node *Node) GetAttrib(attr int64) (*Attr, int64, bool)

func (*Node) Next

func (node *Node) Next() (*Node, error)

func (*Node) Prev

func (node *Node) Prev() (*Node, error)

func (*Node) SetValue

func (node *Node) SetValue(s string) error

func (*Node) TraverseText

func (node *Node) TraverseText(w io.Writer)

func (*Node) TraverseXml

func (node *Node) TraverseXml(w io.Writer)

func (*Node) Value

func (node *Node) Value() string

type NodeInfo

type NodeInfo struct {
	Type      uint
	LocalName string
	Prefix    string
	// contains filtered or unexported fields
}

type NodeNavigator

type NodeNavigator struct {
	Root, Current *Node
	AttrD         int64
	AttrV         *Attr
}

func CreateXPathNavigator

func CreateXPathNavigator(root *Node) *NodeNavigator

func (*NodeNavigator) Copy

func (n *NodeNavigator) Copy() xpath.NodeNavigator

func (*NodeNavigator) LocalName

func (n *NodeNavigator) LocalName() string

func (*NodeNavigator) MoveTo

func (n *NodeNavigator) MoveTo(o xpath.NodeNavigator) bool

func (*NodeNavigator) MoveToChild

func (n *NodeNavigator) MoveToChild() bool

func (*NodeNavigator) MoveToFirst

func (n *NodeNavigator) MoveToFirst() bool

func (*NodeNavigator) MoveToNext

func (n *NodeNavigator) MoveToNext() bool

func (*NodeNavigator) MoveToNextAttribute

func (n *NodeNavigator) MoveToNextAttribute() bool

func (*NodeNavigator) MoveToParent

func (n *NodeNavigator) MoveToParent() bool

func (*NodeNavigator) MoveToPrevious

func (n *NodeNavigator) MoveToPrevious() bool

func (*NodeNavigator) MoveToRoot

func (n *NodeNavigator) MoveToRoot()

func (*NodeNavigator) NodeType

func (n *NodeNavigator) NodeType() xpath.NodeType

func (*NodeNavigator) Prefix

func (n *NodeNavigator) Prefix() string

func (*NodeNavigator) Value

func (n *NodeNavigator) Value() string

Jump to

Keyboard shortcuts

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