Documentation
¶
Index ¶
- func NewGraphDB(conf Config) (gdbi.GraphDB, error)
- type Config
- type Graph
- func (g *Graph) AddEdge(edges []*gdbi.Edge) error
- func (g *Graph) AddVertex(vertices []*gdbi.Vertex) error
- func (g *Graph) AddVertexIndex(label string, field string) error
- func (g *Graph) BulkAdd(stream <-chan *gdbi.GraphElement) error
- func (g *Graph) Compiler() gdbi.Compiler
- func (g *Graph) DelEdge(key string) error
- func (g *Graph) DelVertex(key string) error
- func (g *Graph) DeleteVertexIndex(label string, field string) error
- func (g *Graph) GetEdge(gid string, load bool) *gdbi.Edge
- func (g *Graph) GetEdgeList(ctx context.Context, load bool) <-chan *gdbi.Edge
- func (g *Graph) GetInChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (g *Graph) GetInEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (g *Graph) GetOutChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (g *Graph) GetOutEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (g *Graph) GetTimestamp() string
- func (g *Graph) GetVertex(gid string, load bool) *gdbi.Vertex
- func (g *Graph) GetVertexChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
- func (g *Graph) GetVertexIndexList() <-chan *gripql.IndexID
- func (g *Graph) GetVertexList(ctx context.Context, load bool) <-chan *gdbi.Vertex
- func (g *Graph) ListEdgeLabels() ([]string, error)
- func (g *Graph) ListVertexLabels() ([]string, error)
- func (g *Graph) VertexLabelScan(ctx context.Context, label string) chan string
- type GraphDB
- func (db *GraphDB) AddGraph(graph string) error
- func (db *GraphDB) BuildSchema(ctx context.Context, graphID string, sampleN uint32, random bool) (*gripql.Graph, error)
- func (db *GraphDB) Close() error
- func (db *GraphDB) DeleteGraph(graph string) error
- func (db *GraphDB) Graph(graph string) (gdbi.GraphInterface, error)
- func (db *GraphDB) ListGraphs() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string Port uint User string Password string DBName string SSLMode string }
Config describes the configuration for the sql driver. See https://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters for details.
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph is the interface to a single graph
func (*Graph) AddVertexIndex ¶
AddVertexIndex add index to vertices
func (*Graph) DeleteVertexIndex ¶
DeleteVertexIndex delete index from vertices
func (*Graph) GetEdgeList ¶
GetEdgeList produces a channel of all edges in the graph
func (*Graph) GetInChannel ¶
func (g *Graph) GetInChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInChannel is passed a channel of vertex ids and finds the connected vertices via incoming edges
func (*Graph) GetInEdgeChannel ¶
func (g *Graph) GetInEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInEdgeChannel is passed a channel of vertex ids and finds the incoming edges
func (*Graph) GetOutChannel ¶
func (g *Graph) GetOutChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutChannel is passed a channel of vertex ids and finds the connected vertices via outgoing edges
func (*Graph) GetOutEdgeChannel ¶
func (g *Graph) GetOutEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutEdgeChannel is passed a channel of vertex ids and finds the outgoing edges
func (*Graph) GetTimestamp ¶
GetTimestamp gets the timestamp of last update
func (*Graph) GetVertexChannel ¶
func (g *Graph) GetVertexChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
GetVertexChannel is passed a channel of vertex ids and it produces a channel of vertices
func (*Graph) GetVertexIndexList ¶
GetVertexIndexList lists indices
func (*Graph) GetVertexList ¶
GetVertexList produces a channel of all vertices in the graph
func (*Graph) ListEdgeLabels ¶
ListEdgeLabels returns a list of edge types in the graph
func (*Graph) ListVertexLabels ¶
ListVertexLabels returns a list of vertex types in the graph
type GraphDB ¶
type GraphDB struct {
// contains filtered or unexported fields
}
GraphDB manages graphs in the database
func (*GraphDB) BuildSchema ¶
func (db *GraphDB) BuildSchema(ctx context.Context, graphID string, sampleN uint32, random bool) (*gripql.Graph, error)
BuildSchema returns the schema of a specific graph in the database
func (*GraphDB) DeleteGraph ¶
DeleteGraph deletes an existing graph named `graph`
func (*GraphDB) Graph ¶
func (db *GraphDB) Graph(graph string) (gdbi.GraphInterface, error)
Graph obtains the gdbi.DBI for a particular graph
func (*GraphDB) ListGraphs ¶
ListGraphs lists the graphs managed by this driver