Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultWeight is default weight
DefaultWeight = 1.0
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOptions ¶
AddOptions are store options
type DOTEdge ¶
type DOTEdge interface { Edge // DOTID returns Graphviz DOT ID DOTID() string // SetDOTID sets Graphviz DOT ID SetDOTID(string) }
DOTEdge is a GraphViz DOT Edge
type DOTGraph ¶
type DOTGraph interface { Graph // DOTID returns DOT graph ID DOTID() string // DOTAttributers returns global graph DOT attributes DOTAttributers() (graph, node, edge encoding.Attributer) // DOT returns Graphviz graph DOT() (string, error) }
DOTGraph returns Graphiz DOT store
type DOTNode ¶
type DOTNode interface { Node // DOTID returns Graphviz DOT ID DOTID() string // SetDOTID sets Graphviz DOT ID SetDOTID(string) }
DOTNode is a GraphViz DOT Node
type DOTOptions ¶
DOTOptions are DOT options
type DelOptions ¶
DelOptions are store options
type Edge ¶
type Edge interface { Entity // From returns the from node of the edge From() Node // To returns the to node of the edge. To() Node // Weight returns edge weight Weight() float64 }
Edge is an edge between two nodes
type Entity ¶
type Entity interface { // UID returns unique ID UID() string // Attrs returns attributes Attrs() attrs.Attrs // Metadata returns metadata Metadata() metadata.Metadata }
Entity is store entity
type Graph ¶
type Graph interface { // Node returns the node with the given ID if it exists // in the graph, and nil otherwise. Node(id string) (Node, error) // Nodes returns all the nodes in the graph. Nodes() ([]Node, error) // Edges returns all the edges between the nodes vid and uid Edges(uid, vid string) ([]Edge, error) // Link links two nodes and returns the new edge between them // or it returns error if the link couldn't be created. Link(Node, Node, LinkOptions) (Edge, error) // SubGraph returns a subgraph of the graph starting at Node // up to the given depth or it returns error. SubGraph(Node, int) (Graph, error) }
Graph is a graph of API objects
type LinkOptions ¶
type LinkOptions struct { Line bool Weight float64 Relation string Attrs attrs.Attrs Metadata metadata.Metadata }
LinkOptions are link options
type Options ¶
type Options struct {
DOTOptions DOTOptions
}
Options are store options
func NewOptions ¶
func NewOptions() Options
type Store ¶
type Store interface { Graph // Add adds an api.Object to the store and returns it Add(api.Object, AddOptions) (Entity, error) // Delete deletes an entity from the store Delete(Entity, DelOptions) error // Query queries the store and returns the results Query(*query.Query) ([]Entity, error) }
Store allows to store and query the graph of API objects
Click to show internal directories.
Click to hide internal directories.