hierarch

package
v0.0.0-...-405b8c4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BoolType = 0 + iota
	FloatType
	MapType
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewNode

func NewNode(id string) *Node

func (*Node) AddChild

func (n *Node) AddChild(nn *Node)

func (*Node) AddNewChild

func (n *Node) AddNewChild(id string)

func (*Node) Child

func (n *Node) Child(id string) *Node

func (*Node) ChildByPath

func (n *Node) ChildByPath(path ...string) (*Node, error)

func (*Node) DeletePath

func (n *Node) DeletePath(path ...string)

func (*Node) Map

func (n *Node) Map() map[string]interface{}

func (*Node) MarshalJSON

func (n *Node) MarshalJSON() ([]byte, error)

func (*Node) SetChildByPath

func (n *Node) SetChildByPath(nn *Node, path ...string)

func (*Node) SetStatus

func (n *Node) SetStatus(values map[string]interface{}, recursive bool)

func (*Node) SetValue

func (n *Node) SetValue(v interface{}) error

func (*Node) Status

func (n *Node) Status() map[string]interface{}

func (*Node) String

func (n *Node) String() string

func (*Node) UnmarshalJSON

func (n *Node) UnmarshalJSON(b []byte) error

UnmarshalJSON constructs a Node from it's JSON encoded value. A Node created this way is not necessarily ready to be used on a Tree.

func (*Node) Value

func (n *Node) Value() *Value

func (*Node) Version

func (n *Node) Version() (uint64, error)

type Tree

type Tree struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewTree

func NewTree() *Tree

func (*Tree) DeleteNode

func (tree *Tree) DeleteNode(path ...string) error

func (*Tree) NewNode

func (tree *Tree) NewNode(id string, path ...string)

func (*Tree) Node

func (tree *Tree) Node(path ...string) (*Node, error)

func (*Tree) NodeStatus

func (tree *Tree) NodeStatus(path ...string) (map[string]interface{}, error)

func (*Tree) SetNodeStatus

func (tree *Tree) SetNodeStatus(values map[string]interface{}, recursive bool, bubbleUp bool, path ...string) error

func (*Tree) String

func (tree *Tree) String() string

func (*Tree) Version

func (tree *Tree) Version() uint64

type Value

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

func NewValue

func NewValue(v interface{}) (*Value, error)

func (*Value) Bool

func (v *Value) Bool() (bool, error)

func (*Value) Float

func (v *Value) Float() (float64, error)

func (*Value) Map

func (v *Value) Map() (map[string]*Value, error)

func (*Value) MarshalJSON

func (v *Value) MarshalJSON() ([]byte, error)

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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