Documentation ¶
Index ¶
- func NewGraphDB(conf Config) (gdbi.GraphDB, error)
- func PackEdge(e *gdbi.Edge) map[string]interface{}
- func PackVertex(v *gdbi.Vertex) map[string]interface{}
- func UnpackEdge(i map[string]interface{}) *gripql.Edge
- func UnpackVertex(i map[string]interface{}) *gripql.Vertex
- type Config
- type Graph
- func (es *Graph) AddEdge(edges []*gdbi.Edge) error
- func (es *Graph) AddVertex(vertices []*gdbi.Vertex) error
- func (es *Graph) AddVertexIndex(label string, field string) error
- func (es *Graph) BulkAdd(stream <-chan *gdbi.GraphElement) error
- func (es *Graph) Compiler() gdbi.Compiler
- func (es *Graph) DelEdge(eid string) error
- func (es *Graph) DelVertex(vid string) error
- func (es *Graph) DeleteVertexIndex(label string, field string) error
- func (es *Graph) GetEdge(id string, load bool) *gdbi.Edge
- func (es *Graph) GetEdgeList(ctx context.Context, load bool) <-chan *gdbi.Edge
- func (es *Graph) GetInChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (es *Graph) GetInEdgeChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (es *Graph) GetOutChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (es *Graph) GetOutEdgeChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (es *Graph) GetTimestamp() string
- func (es *Graph) GetVertex(id string, load bool) *gdbi.Vertex
- func (es *Graph) GetVertexChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
- func (es *Graph) GetVertexIndexList() <-chan *gripql.IndexID
- func (es *Graph) GetVertexList(ctx context.Context, load bool) <-chan *gdbi.Vertex
- func (es *Graph) ListEdgeLabels() ([]string, error)
- func (es *Graph) ListVertexLabels() ([]string, error)
- func (es *Graph) VertexLabelScan(ctx context.Context, label string) chan string
- type GraphDB
- func (es *GraphDB) AddGraph(graph string) error
- func (es *GraphDB) BuildSchema(ctx context.Context, graph string, sampleN uint32, random bool) (*gripql.Graph, error)
- func (es *GraphDB) Close() error
- func (es *GraphDB) DeleteGraph(graph string) error
- func (es *GraphDB) Graph(graph string) (gdbi.GraphInterface, error)
- func (es *GraphDB) ListGraphs() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGraphDB ¶
NewGraphDB creates a new elasticsearch graph database interface
func PackVertex ¶
PackVertex take a gdbi vertex and convert it to a mongo doc
func UnpackEdge ¶
UnpackEdge takes a mongo doc and convertes it into an gripql.Edge
func UnpackVertex ¶
UnpackVertex takes a mongo doc and converts it into an gripql.Vertex
Types ¶
type Config ¶
type Config struct { URL string DBName string Username string Password string Synchronous bool BatchSize int }
Config describes the configuration for the elasticsearch driver.
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph is a graph database backended by elastic search
func (*Graph) AddEdge ¶
AddEdge adds an edge to the graph, if the id is not "" and in already exists in the graph, it is replaced
func (*Graph) AddVertex ¶
AddVertex adds an edge to the graph, if the id is not "" and in already exists in the graph, it is replaced
func (*Graph) AddVertexIndex ¶
AddVertexIndex adds a new field to be indexed
func (*Graph) Compiler ¶
Compiler returns a query compiler that will use elastic search as a backend
func (*Graph) DeleteVertexIndex ¶
DeleteVertexIndex removes a vertex field index
func (*Graph) GetEdgeList ¶
GetEdgeList produces a channel of all edges in the graph
func (*Graph) GetInChannel ¶
func (es *Graph) GetInChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInChannel gets all vertices connected to lookup elements by incoming edges
func (*Graph) GetInEdgeChannel ¶
func (es *Graph) GetInEdgeChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInEdgeChannel gets incoming edges connected to lookup element
func (*Graph) GetOutChannel ¶
func (es *Graph) GetOutChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutChannel gets channel of all vertices connected to element via outgoing edge
func (*Graph) GetOutEdgeChannel ¶
func (es *Graph) GetOutEdgeChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutEdgeChannel gets all outgoing edges connected to lookup element
func (*Graph) GetTimestamp ¶
GetTimestamp returns the change timestamp of the current graph
func (*Graph) GetVertexChannel ¶
func (es *Graph) GetVertexChannel(ctx context.Context, req chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
GetVertexChannel get a channel that returns all vertices in a graph
func (*Graph) GetVertexIndexList ¶
GetVertexIndexList gets list if vertex 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 implements the GraphDB interface with elasticsearch as a backend
func (*GraphDB) BuildSchema ¶
func (es *GraphDB) BuildSchema(ctx context.Context, graph string, sampleN uint32, random bool) (*gripql.Graph, error)
BuildSchema returns the schema of a specific graph in the database
func (*GraphDB) DeleteGraph ¶
DeleteGraph deletes a graph from the graphdb
func (*GraphDB) Graph ¶
func (es *GraphDB) Graph(graph string) (gdbi.GraphInterface, error)
Graph returns interface to a specific graph in the graphdb
func (*GraphDB) ListGraphs ¶
ListGraphs returns list of graphs on elastic search instance