data

package
v0.0.0-...-fc2a63e Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: BSD-3-Clause, MPL-2.0 Imports: 2 Imported by: 5

README

basic nary tree structure

Package data is the base storage for the union data structure.

Documentation

Overview

Package data is the base storage for the union data structure. * It provides the basic nary tree structure.

Index

Constants

View Source
const (
	ClearChildFlags     = true
	DontClearChildFlags = false
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicNode

type AtomicNode struct {
	atomic.Value
}

func NewAtomicNode

func NewAtomicNode(n *Node) *AtomicNode

func (*AtomicNode) Load

func (t *AtomicNode) Load() *Node

func (*AtomicNode) Store

func (t *AtomicNode) Store(n *Node)

type BySystem

type BySystem []*Node

func (BySystem) Len

func (b BySystem) Len() int

func (BySystem) Less

func (b BySystem) Less(i, j int) bool

func (BySystem) Swap

func (b BySystem) Swap(i, j int)

type ByUser

type ByUser []*Node

func (ByUser) Len

func (b ByUser) Len() int

func (ByUser) Less

func (b ByUser) Less(i, j int) bool

func (ByUser) Swap

func (b ByUser) Swap(i, j int)

type Node

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

func New

func New(name string) *Node

func (*Node) AddChild

func (n *Node) AddChild(child *Node)

func (*Node) Child

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

func (*Node) ChildMap

func (n *Node) ChildMap() map[string]*Node

func (*Node) ChildNames

func (n *Node) ChildNames() []string

func (*Node) Children

func (n *Node) Children() []*Node

func (*Node) ClearChildren

func (n *Node) ClearChildren()

func (*Node) ClearDefault

func (n *Node) ClearDefault()

func (*Node) ClearDeleted

func (n *Node) ClearDeleted()

func (*Node) ClearOpaque

func (n *Node) ClearOpaque()

func (*Node) Comment

func (n *Node) Comment() string

func (*Node) Copy

func (n *Node) Copy() *Node

func (*Node) Default

func (n *Node) Default() bool

func (*Node) DeleteChild

func (n *Node) DeleteChild(name string)

func (*Node) Deleted

func (n *Node) Deleted() bool

func (*Node) Index

func (n *Node) Index() uint64

func (*Node) MarkDefault

func (n *Node) MarkDefault()

func (*Node) MarkDeleted

func (n *Node) MarkDeleted(clearChildFlagsWhenDeletingParent bool)

Depending on the type of delete, we may or may not clear the children's flags. When checking authorization on each node, we don't clear, eg when we are doing the likes of a load operation and deleting everything in the tree which we are authorized to delete. If we cleared the flags on the children, then when we add the new config on top of previous deletions, they will reappear if their parent is recreated.

func (*Node) MarkOpaque

func (n *Node) MarkOpaque()

func (*Node) Name

func (n *Node) Name() string

func (*Node) NumChildren

func (n *Node) NumChildren() int

func (*Node) Opaque

func (n *Node) Opaque() bool

func (*Node) SetComment

func (n *Node) SetComment(comment string)

func (*Node) SetIndex

func (n *Node) SetIndex(idx uint64)

func (*Node) SetNoValidate

func (n *Node) SetNoValidate(path []string)

Jump to

Keyboard shortcuts

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