Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute interface { // Key is the value of the attribute identifier. This must always be a string. Key() string // Kind represent the value type. Kind() Kind // IsNull will return true if the attribute type is null. IsNull() bool // AsBool will return the attribute values as a boolean. AsBool() (bool, error) // AsInt will return the attribute value as an int. AsInt() (int64, error) // AsFloat will return the attribute value as a float. AsFloat() (float64, error) // AsString will return the attribute value as a string. AsString() (string, error) // AsAny returns the value of the attribute with no type checking. AsAny() interface{} }
Attribute defines methods of an attribute object.
type AttributeSet ¶
type AttributeSet interface { // Exists returns whether a key, value with type pair exists Exists(Attribute) (bool, error) // Find returns all values associated with a specified key Find(string) Attribute // List will list all key,value pairs for the attributes in a // consumable format. List() map[string]Attribute // Len returns the attribute set length Len() int // MarshalJSON returns a json representation of the Attribute set. // Compliant with std lib JSON marshaler. MarshalJSON() ([]byte, error) }
AttributeSet defines methods for manipulating attribute sets. Nodes have set of attributes that allow them to self-describe and describe connected nodes.
type DirectedGraph ¶
type DirectedGraph interface { // Nodes lists all nodes contained within the // graph. Nodes() []Node // Edges lists all edges contained within the // graph. Edges() []Edge // NodeByID returns a node from the given // id, if existing. NodeByID(string) Node // Edge creates or returns an Edge from the given // node ids. Edge(string, string) Edge // HasEdgeFromTo returns whether an edge exits between // two nodes. HasEdgeFromTo(string, string) bool // From lists all child nodes for a given node // id, if existing. From(string) []Node // To lists all parent nodes for a given node // id, if existing. To(string) []Node }
DirectedGraph defines methods for interacting with groups of nodes and edges in a directed graph structure. This graph may or may not contain cycles.
type Edge ¶
type Edge interface { // To is the destination node. To() Node // From is the origin node. From() Node }
Edge defines methods for node relationship information. This may eventually include weight information to represent nodes at addresses that are a longer distance from the source.
type Iterator ¶
type Iterator interface { // Next returns true if there is more data to iterate // and will increment. Next() bool // Node will return the node in the current position. Node() Node // Reset will start the iterator from the beginning Reset() // Error will return all accumulated errors during iteration. Error() error }
Iterator defines method for traversing node data in a specified order.
type MatcherFunc ¶
MatcherFunc is function signature that implements the Matcher interface.
type Node ¶
type Node interface { // ID is a unique value assigned to the node. ID() string // Address is the location where the data is stored Address() string // Attributes defines the attributes associated // with the node data Attributes() AttributeSet }
Node defines read-only methods implemented by different node types.
type NodeBuilder ¶
NodeBuilder defines methods to build new nodes.