Documentation
¶
Index ¶
- Constants
- type CayleyGraph
- func (g *CayleyGraph) AllNodesOfType(ntypes ...string) ([]Node, error)
- func (g *CayleyGraph) Close()
- func (g *CayleyGraph) CountInEdges(node Node, predicates ...string) (int, error)
- func (g *CayleyGraph) CountOutEdges(node Node, predicates ...string) (int, error)
- func (g *CayleyGraph) CountProperties(node Node, predicates ...string) (int, error)
- func (g *CayleyGraph) DeleteEdge(edge *Edge) error
- func (g *CayleyGraph) DeleteNode(node Node) error
- func (g *CayleyGraph) DeleteProperty(node Node, predicate, value string) error
- func (g *CayleyGraph) DumpGraph() string
- func (g *CayleyGraph) InsertEdge(edge *Edge) error
- func (g *CayleyGraph) InsertNode(id, ntype string) (Node, error)
- func (g *CayleyGraph) InsertProperty(node Node, predicate, value string) error
- func (g *CayleyGraph) NodeToID(n Node) string
- func (g *CayleyGraph) ReadEdges(node Node, predicates ...string) ([]*Edge, error)
- func (g *CayleyGraph) ReadInEdges(node Node, predicates ...string) ([]*Edge, error)
- func (g *CayleyGraph) ReadNode(id, ntype string) (Node, error)
- func (g *CayleyGraph) ReadOutEdges(node Node, predicates ...string) ([]*Edge, error)
- func (g *CayleyGraph) ReadProperties(node Node, predicates ...string) ([]*Property, error)
- func (g *CayleyGraph) String() string
- type Edge
- type GraphDatabase
- type Gremlin
- func (g *Gremlin) AllNodesOfType(ntypes ...string) ([]Node, error)
- func (g *Gremlin) Close()
- func (g *Gremlin) CountInEdges(node Node, predicates ...string) (int, error)
- func (g *Gremlin) CountOutEdges(node Node, predicates ...string) (int, error)
- func (g *Gremlin) CountProperties(node Node, predicates ...string) (int, error)
- func (g *Gremlin) DeleteEdge(edge *Edge) error
- func (g *Gremlin) DeleteNode(node Node) error
- func (g *Gremlin) DeleteProperty(node Node, predicate, value string) error
- func (g *Gremlin) DumpGraph() string
- func (g *Gremlin) InsertEdge(edge *Edge) error
- func (g *Gremlin) InsertNode(id, ntype string) (Node, error)
- func (g *Gremlin) InsertProperty(node Node, predicate, value string) error
- func (g *Gremlin) NodeToID(n Node) string
- func (g *Gremlin) ReadEdges(node Node, predicates ...string) ([]*Edge, error)
- func (g *Gremlin) ReadInEdges(node Node, predicates ...string) ([]*Edge, error)
- func (g *Gremlin) ReadNode(id, ntype string) (Node, error)
- func (g *Gremlin) ReadOutEdges(node Node, predicates ...string) ([]*Edge, error)
- func (g *Gremlin) ReadProperties(node Node, predicates ...string) ([]*Property, error)
- func (g *Gremlin) String() string
- type Node
- type Property
Constants ¶
const ( IN int = iota OUT BOTH )
Constant values that represent the direction of edges during graph queries.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CayleyGraph ¶
CayleyGraph is the object for managing a network infrastructure link graph.
func NewCayleyGraph ¶
func NewCayleyGraph(path string) *CayleyGraph
NewCayleyGraph returns an intialized CayleyGraph object.
func NewCayleyGraphMemory ¶
func NewCayleyGraphMemory() *CayleyGraph
NewCayleyGraphMemory creates a temporary graph in memory.
func (*CayleyGraph) AllNodesOfType ¶
func (g *CayleyGraph) AllNodesOfType(ntypes ...string) ([]Node, error)
AllNodesOfType implements the GraphDatabase interface.
func (*CayleyGraph) Close ¶
func (g *CayleyGraph) Close()
Close implements the GraphDatabase interface.
func (*CayleyGraph) CountInEdges ¶
func (g *CayleyGraph) CountInEdges(node Node, predicates ...string) (int, error)
CountInEdges implements the GraphDatabase interface.
func (*CayleyGraph) CountOutEdges ¶
func (g *CayleyGraph) CountOutEdges(node Node, predicates ...string) (int, error)
CountOutEdges implements the GraphDatabase interface.
func (*CayleyGraph) CountProperties ¶
func (g *CayleyGraph) CountProperties(node Node, predicates ...string) (int, error)
CountProperties implements the GraphDatabase interface.
func (*CayleyGraph) DeleteEdge ¶
func (g *CayleyGraph) DeleteEdge(edge *Edge) error
DeleteEdge implements the GraphDatabase interface.
func (*CayleyGraph) DeleteNode ¶
func (g *CayleyGraph) DeleteNode(node Node) error
DeleteNode implements the GraphDatabase interface.
func (*CayleyGraph) DeleteProperty ¶
func (g *CayleyGraph) DeleteProperty(node Node, predicate, value string) error
DeleteProperty implements the GraphDatabase interface.
func (*CayleyGraph) DumpGraph ¶
func (g *CayleyGraph) DumpGraph() string
DumpGraph returns a string containing all data currently in the graph.
func (*CayleyGraph) InsertEdge ¶
func (g *CayleyGraph) InsertEdge(edge *Edge) error
InsertEdge implements the GraphDatabase interface.
func (*CayleyGraph) InsertNode ¶
func (g *CayleyGraph) InsertNode(id, ntype string) (Node, error)
InsertNode implements the GraphDatabase interface.
func (*CayleyGraph) InsertProperty ¶
func (g *CayleyGraph) InsertProperty(node Node, predicate, value string) error
InsertProperty implements the GraphDatabase interface.
func (*CayleyGraph) NodeToID ¶
func (g *CayleyGraph) NodeToID(n Node) string
NodeToID implements the GraphDatabase interface.
func (*CayleyGraph) ReadEdges ¶
func (g *CayleyGraph) ReadEdges(node Node, predicates ...string) ([]*Edge, error)
ReadEdges implements the GraphDatabase interface.
func (*CayleyGraph) ReadInEdges ¶
func (g *CayleyGraph) ReadInEdges(node Node, predicates ...string) ([]*Edge, error)
ReadInEdges implements the GraphDatabase interface.
func (*CayleyGraph) ReadNode ¶
func (g *CayleyGraph) ReadNode(id, ntype string) (Node, error)
ReadNode implements the GraphDatabase interface.
func (*CayleyGraph) ReadOutEdges ¶
func (g *CayleyGraph) ReadOutEdges(node Node, predicates ...string) ([]*Edge, error)
ReadOutEdges implements the GraphDatabase interface.
func (*CayleyGraph) ReadProperties ¶
func (g *CayleyGraph) ReadProperties(node Node, predicates ...string) ([]*Property, error)
ReadProperties implements the GraphDatabase interface.
func (*CayleyGraph) String ¶
func (g *CayleyGraph) String() string
String returns a description for the CayleyGraph object.
type GraphDatabase ¶
type GraphDatabase interface { fmt.Stringer NodeToID(node Node) string // Provides all nodes in the graph of the identified types AllNodesOfType(ntypes ...string) ([]Node, error) // Graph operations for adding and removing nodes InsertNode(id, ntype string) (Node, error) ReadNode(id, ntype string) (Node, error) DeleteNode(node Node) error // Graph operations for manipulating properties of a node InsertProperty(node Node, predicate, value string) error ReadProperties(node Node, predicates ...string) ([]*Property, error) CountProperties(node Node, predicates ...string) (int, error) DeleteProperty(node Node, predicate, value string) error // Graph operations for adding and removing edges InsertEdge(edge *Edge) error ReadEdges(node Node, predicates ...string) ([]*Edge, error) ReadInEdges(node Node, predicates ...string) ([]*Edge, error) CountInEdges(node Node, predicates ...string) (int, error) ReadOutEdges(node Node, predicates ...string) ([]*Edge, error) CountOutEdges(node Node, predicates ...string) (int, error) DeleteEdge(edge *Edge) error // Signals the database to close Close() }
GraphDatabase is the interface for storage of Amass data.
type Gremlin ¶
Gremlin is the client object for a Gremlin/TinkerPop graph database connection.
func NewGremlin ¶
NewGremlin returns a client object that implements the GraphDatabase interface. The url param typically looks like the following: ws://localhost:8182
func (*Gremlin) AllNodesOfType ¶
AllNodesOfType implements the GraphDatabase interface.
func (*Gremlin) CountInEdges ¶
CountInEdges implements the GraphDatabase interface.
func (*Gremlin) CountOutEdges ¶
CountOutEdges implements the GraphDatabase interface.
func (*Gremlin) CountProperties ¶
CountProperties implements the GraphDatabase interface.
func (*Gremlin) DeleteEdge ¶
DeleteEdge implements the GraphDatabase interface.
func (*Gremlin) DeleteNode ¶
DeleteNode implements the GraphDatabase interface.
func (*Gremlin) DeleteProperty ¶
DeleteProperty implements the GraphDatabase interface.
func (*Gremlin) InsertEdge ¶
InsertEdge implements the GraphDatabase interface.
func (*Gremlin) InsertNode ¶
InsertNode implements the GraphDatabase interface.
func (*Gremlin) InsertProperty ¶
InsertProperty implements the GraphDatabase interface.
func (*Gremlin) ReadInEdges ¶
ReadInEdges implements the GraphDatabase interface.
func (*Gremlin) ReadOutEdges ¶
ReadOutEdges implements the GraphDatabase interface.
func (*Gremlin) ReadProperties ¶
ReadProperties implements the GraphDatabase interface.