snap: github.com/intelsdi-x/snap/core/cdata Index | Files

package cdata

import "github.com/intelsdi-x/snap/core/cdata"

Index

Package Files

node.go tree.go

type ConfigDataNode Uses

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

Represents a set of configuration data

func FromTable Uses

func FromTable(table map[string]ctypes.ConfigValue) *ConfigDataNode

func NewNode Uses

func NewNode() *ConfigDataNode

Returns a new and empty node.

func (*ConfigDataNode) AddItem Uses

func (c *ConfigDataNode) AddItem(k string, v ctypes.ConfigValue)

Adds an item to the ConfigDataNode.

func (*ConfigDataNode) ApplyDefaults Uses

func (c *ConfigDataNode) ApplyDefaults(defaults map[string]ctypes.ConfigValue)

ApplyDefaults will set default values if the given ConfigDataNode doesn't already have a value for the given configuration.

func (ConfigDataNode) DeleteItem Uses

func (c ConfigDataNode) DeleteItem(k string)

Deletes a field in ConfigDataNode. If the field does not exist Delete is considered a no-op

func (*ConfigDataNode) GobDecode Uses

func (c *ConfigDataNode) GobDecode(buf []byte) error

GobDecode decodes a GOB into a ConfigDataNode

func (*ConfigDataNode) GobEncode Uses

func (c *ConfigDataNode) GobEncode() ([]byte, error)

GobEcode encodes a ConfigDataNode in go binary format

func (*ConfigDataNode) MarshalJSON Uses

func (c *ConfigDataNode) MarshalJSON() ([]byte, error)

MarshalJSON marshals a ConfigDataNode into JSON

func (ConfigDataNode) Merge Uses

func (c ConfigDataNode) Merge(n ctree.Node) ctree.Node

Merges a ConfigDataNode on top of this one (overwriting items where it occurs).

func (*ConfigDataNode) ReverseMerge Uses

func (c *ConfigDataNode) ReverseMerge(n ctree.Node) *ConfigDataNode

Merges a ConfigDataNode with a copy of the current ConfigDataNode and returns the copy. The merge does not overwrite any conflicting values. Any conflicts are decided by the callers value.

func (*ConfigDataNode) ReverseMergeInPlace Uses

func (c *ConfigDataNode) ReverseMergeInPlace(n ctree.Node) ctree.Node

Merges a ConfigDataNode with this one but does not overwrite any conflicting values. Any conflicts are decided by the callers value.

func (*ConfigDataNode) Table Uses

func (c *ConfigDataNode) Table() map[string]ctypes.ConfigValue

Returns the table of configuration items [key(string) / value(core.ConfigValue)].

func (*ConfigDataNode) UnmarshalJSON Uses

func (c *ConfigDataNode) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals JSON into a ConfigDataNode

type ConfigDataTree Uses

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

Allows adding of config data by namespace and retrieving of data from tree at a specific namespace (merging the relevant hierarchy). Uses pkg.ConfigTree.

func NewTree Uses

func NewTree() *ConfigDataTree

Returns a new ConfigDataTree.

func (*ConfigDataTree) Add Uses

func (c *ConfigDataTree) Add(ns []string, cdn *ConfigDataNode)

Adds a ConfigDataNode at the provided namespace.

func (*ConfigDataTree) Get Uses

func (c *ConfigDataTree) Get(ns []string) *ConfigDataNode

Returns a ConfigDataNode that is a merged version of the namespace provided.

func (*ConfigDataTree) GobDecode Uses

func (c *ConfigDataTree) GobDecode(buf []byte) error

func (*ConfigDataTree) GobEncode Uses

func (c *ConfigDataTree) GobEncode() ([]byte, error)

Package cdata imports 7 packages (graph) and is imported by 107 packages. Updated 2017-02-04. Refresh now. Tools for package owners.