Documentation ¶
Index ¶
- func DstEdgeKey(graph, src, dst, eid, label string, etype byte) []byte
- func DstEdgeKeyParse(key []byte) (string, string, string, string, string, byte)
- func DstEdgeKeyPrefix(graph, src, dst, eid string) []byte
- func DstEdgeListPrefix(graph string) []byte
- func DstEdgePrefix(graph, id string) []byte
- func EdgeKey(graph, id, src, dst, label string, etype byte) []byte
- func EdgeKeyParse(key []byte) (string, string, string, string, string, byte)
- func EdgeKeyPrefix(graph, id string) []byte
- func EdgeListPrefix(graph string) []byte
- func GraphKey(graph string) []byte
- func GraphKeyParse(key []byte) string
- func GraphPrefix() []byte
- func NewKVGraph(kv kvi.KVInterface) gdbi.GraphDB
- func NewKVGraphDB(name string, dbPath string) (gdbi.GraphDB, error)
- func SrcEdgeKey(graph, src, dst, eid, label string, etype byte) []byte
- func SrcEdgeKeyParse(key []byte) (string, string, string, string, string, byte)
- func SrcEdgeKeyPrefix(graph, src, dst, eid string) []byte
- func SrcEdgeListPrefix(graph string) []byte
- func SrcEdgePrefix(graph, id string) []byte
- func VertexKey(graph, id string) []byte
- func VertexKeyParse(key []byte) (string, string)
- func VertexListPrefix(graph string) []byte
- type KVGraph
- func (kgraph *KVGraph) AddGraph(graph string) error
- func (ma *KVGraph) BuildSchema(ctx context.Context, graph string, sampleN uint32, random bool) (*gripql.Graph, error)
- func (kgraph *KVGraph) Close() error
- func (kgraph *KVGraph) DeleteGraph(graph string) error
- func (kgraph *KVGraph) Graph(graph string) (gdbi.GraphInterface, error)
- func (kgraph *KVGraph) ListGraphs() []string
- type KVInterfaceGDB
- func (kgdb *KVInterfaceGDB) AddEdge(edges []*gdbi.Edge) error
- func (kgdb *KVInterfaceGDB) AddVertex(vertices []*gdbi.Vertex) error
- func (kgdb *KVInterfaceGDB) AddVertexIndex(label string, field string) error
- func (kgdb *KVInterfaceGDB) BulkAdd(stream <-chan *gdbi.GraphElement) error
- func (kgdb *KVInterfaceGDB) Compiler() gdbi.Compiler
- func (kgdb *KVInterfaceGDB) DelEdge(eid string) error
- func (kgdb *KVInterfaceGDB) DelVertex(id string) error
- func (kgdb *KVInterfaceGDB) DeleteVertexIndex(label string, field string) error
- func (kgdb *KVInterfaceGDB) GetEdge(id string, loadProp bool) *gdbi.Edge
- func (kgdb *KVInterfaceGDB) GetEdgeList(ctx context.Context, loadProp bool) <-chan *gdbi.Edge
- func (kgdb *KVInterfaceGDB) GetInChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (kgdb *KVInterfaceGDB) GetInEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (kgdb *KVInterfaceGDB) GetOutChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (kgdb *KVInterfaceGDB) GetOutEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (kgdb *KVInterfaceGDB) GetTimestamp() string
- func (kgdb *KVInterfaceGDB) GetVertex(id string, loadProp bool) *gdbi.Vertex
- func (kgdb *KVInterfaceGDB) GetVertexChannel(ctx context.Context, ids chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
- func (kgdb *KVInterfaceGDB) GetVertexIndexList() <-chan *gripql.IndexID
- func (kgdb *KVInterfaceGDB) GetVertexList(ctx context.Context, loadProp bool) <-chan *gdbi.Vertex
- func (kgdb *KVInterfaceGDB) ListEdgeLabels() ([]string, error)
- func (kgdb *KVInterfaceGDB) ListVertexLabels() ([]string, error)
- func (kgdb *KVInterfaceGDB) VertexLabelScan(ctx context.Context, label string) chan string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DstEdgeKey ¶
DstEdgeKey creates a dest edge index key
func DstEdgeKeyParse ¶
DstEdgeKeyParse takes a dest index key entry and parses it into: `graph`, `dstVertexId`, `srcVertexId`, `edgeId`, `label`, `etype`
func DstEdgeKeyPrefix ¶
DstEdgeKeyPrefix creates a byte array prefix for a dest edge index entry
func DstEdgeListPrefix ¶
DstEdgeListPrefix returns a byte array prefix for all entries in the dest edge index for a graph
func DstEdgePrefix ¶
DstEdgePrefix returns a byte array prefix for all entries in the dest edge index a particular vertex (the dest vertex)
func EdgeKeyParse ¶
EdgeKeyParse takes a edge key and returns the elements encoded in it: `graph`, `edgeID`, `srcVertexId`, `dstVertexId`, `label`, `edgeType`
func EdgeKeyPrefix ¶
EdgeKeyPrefix returns the byte array prefix for a particular edge id
func EdgeListPrefix ¶
EdgeListPrefix returns a byte array prefix for all edges in a graph
func GraphKeyParse ¶
GraphKeyParse extracts the string name of a graph from a byte key
func GraphPrefix ¶
func GraphPrefix() []byte
GraphPrefix returns the byte array prefix for all graph entry keys
func NewKVGraph ¶
func NewKVGraph(kv kvi.KVInterface) gdbi.GraphDB
NewKVGraph creats a new instance of KVGraph given a KVInterface
func NewKVGraphDB ¶
NewKVGraphDB intitalize a new key value graph driver given the name of the driver and path/url to create the database at
func SrcEdgeKey ¶
SrcEdgeKey creates a src edge index key
func SrcEdgeKeyParse ¶
SrcEdgeKeyParse takes a src index key entry and parses it into: `graph`, `srcVertexId`, `dstVertexId`, `edgeId`, `label`, `etype`
func SrcEdgeKeyPrefix ¶
SrcEdgeKeyPrefix creates a byte array prefix for a src edge index entry
func SrcEdgeListPrefix ¶
SrcEdgeListPrefix returns a byte array prefix for all entries in the source edge index for a graph
func SrcEdgePrefix ¶
SrcEdgePrefix returns a byte array prefix for all entries in the source edge index a particular vertex (the source vertex)
func VertexKeyParse ¶
VertexKeyParse takes a byte array key and returns: `graphId`, `vertexId`
func VertexListPrefix ¶
VertexListPrefix returns a byte array prefix for all vertices in a graph
Types ¶
type KVGraph ¶
type KVGraph struct {
// contains filtered or unexported fields
}
KVGraph implements the GripInterface using a generic key/value storage driver
func (*KVGraph) BuildSchema ¶
func (ma *KVGraph) 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 (*KVGraph) DeleteGraph ¶
DeleteGraph deletes `graph`
func (*KVGraph) Graph ¶
func (kgraph *KVGraph) Graph(graph string) (gdbi.GraphInterface, error)
Graph obtains the gdbi.DBI for a particular graph
func (*KVGraph) ListGraphs ¶
ListGraphs lists the graphs managed by this driver
type KVInterfaceGDB ¶
type KVInterfaceGDB struct {
// contains filtered or unexported fields
}
KVInterfaceGDB implements the GDB interface using a genertic key/value storage driver
func (*KVInterfaceGDB) AddEdge ¶
func (kgdb *KVInterfaceGDB) AddEdge(edges []*gdbi.Edge) error
AddEdge adds an edge to the graph, if the id is not "" and in already exists in the graph, it is replaced
func (*KVInterfaceGDB) AddVertex ¶
func (kgdb *KVInterfaceGDB) AddVertex(vertices []*gdbi.Vertex) error
AddVertex adds an edge to the graph, if it already exists in the graph, it is replaced
func (*KVInterfaceGDB) AddVertexIndex ¶
func (kgdb *KVInterfaceGDB) AddVertexIndex(label string, field string) error
AddVertexIndex add index to vertices
func (*KVInterfaceGDB) BulkAdd ¶
func (kgdb *KVInterfaceGDB) BulkAdd(stream <-chan *gdbi.GraphElement) error
func (*KVInterfaceGDB) Compiler ¶
func (kgdb *KVInterfaceGDB) Compiler() gdbi.Compiler
Compiler gets a compiler that will use the graph the execute the compiled query
func (*KVInterfaceGDB) DelEdge ¶
func (kgdb *KVInterfaceGDB) DelEdge(eid string) error
DelEdge deletes edge with id `key`
func (*KVInterfaceGDB) DelVertex ¶
func (kgdb *KVInterfaceGDB) DelVertex(id string) error
DelVertex deletes vertex with id `key`
func (*KVInterfaceGDB) DeleteVertexIndex ¶
func (kgdb *KVInterfaceGDB) DeleteVertexIndex(label string, field string) error
DeleteVertexIndex delete index from vertices
func (*KVInterfaceGDB) GetEdge ¶
func (kgdb *KVInterfaceGDB) GetEdge(id string, loadProp bool) *gdbi.Edge
GetEdge loads an edge given an id. It returns nil if not found
func (*KVInterfaceGDB) GetEdgeList ¶
GetEdgeList produces a channel of all edges in the graph
func (*KVInterfaceGDB) GetInChannel ¶
func (kgdb *KVInterfaceGDB) GetInChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInChannel process requests of vertex ids and find the connected vertices on incoming edges
func (*KVInterfaceGDB) GetInEdgeChannel ¶
func (kgdb *KVInterfaceGDB) GetInEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInEdgeChannel process requests of vertex ids and find the connected incoming edges
func (*KVInterfaceGDB) GetOutChannel ¶
func (kgdb *KVInterfaceGDB) GetOutChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutChannel process requests of vertex ids and find the connected vertices on outgoing edges
func (*KVInterfaceGDB) GetOutEdgeChannel ¶
func (kgdb *KVInterfaceGDB) GetOutEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutEdgeChannel process requests of vertex ids and find the connected outgoing edges
func (*KVInterfaceGDB) GetTimestamp ¶
func (kgdb *KVInterfaceGDB) GetTimestamp() string
GetTimestamp returns the update timestamp
func (*KVInterfaceGDB) GetVertex ¶
func (kgdb *KVInterfaceGDB) GetVertex(id string, loadProp bool) *gdbi.Vertex
GetVertex loads a vertex given an id. It returns a nil if not found
func (*KVInterfaceGDB) GetVertexChannel ¶
func (kgdb *KVInterfaceGDB) GetVertexChannel(ctx context.Context, ids chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
GetVertexChannel is passed a channel of vertex ids and it produces a channel of vertices
func (*KVInterfaceGDB) GetVertexIndexList ¶
func (kgdb *KVInterfaceGDB) GetVertexIndexList() <-chan *gripql.IndexID
GetVertexIndexList lists out all the vertex indices for a graph
func (*KVInterfaceGDB) GetVertexList ¶
GetVertexList produces a channel of all edges in the graph
func (*KVInterfaceGDB) ListEdgeLabels ¶
func (kgdb *KVInterfaceGDB) ListEdgeLabels() ([]string, error)
ListEdgeLabels returns a list of edge types in the graph
func (*KVInterfaceGDB) ListVertexLabels ¶
func (kgdb *KVInterfaceGDB) ListVertexLabels() ([]string, error)
ListVertexLabels returns a list of vertex types in the graph
func (*KVInterfaceGDB) VertexLabelScan ¶
func (kgdb *KVInterfaceGDB) VertexLabelScan(ctx context.Context, label string) chan string
VertexLabelScan produces a channel of all vertex ids in a graph that match a given label