Documentation ¶
Index ¶
- Constants
- func DualProcessor(ctx context.Context, reqChan chan ElementLookup, load bool, loader LoadData, ...) chan ElementLookup
- func LookupBatcher(req chan ElementLookup, batchSize int, timeout time.Duration) chan []ElementLookup
- type Aggregate
- type BaseTraveler
- func (t *BaseTraveler) AddCurrent(r *DataElement) Traveler
- func (t *BaseTraveler) AddMark(label string, r *DataElement) Traveler
- func (t *BaseTraveler) Copy() Traveler
- func (t BaseTraveler) GetAggregation() *Aggregate
- func (t *BaseTraveler) GetCount() uint32
- func (t *BaseTraveler) GetCurrent() *DataElement
- func (t *BaseTraveler) GetCurrentID() string
- func (t *BaseTraveler) GetMark(label string) *DataElement
- func (t *BaseTraveler) GetPath() []DataElementID
- func (t *BaseTraveler) GetRender() interface{}
- func (t *BaseTraveler) GetSelections() map[string]*DataElement
- func (tr *BaseTraveler) GetSignal() Signal
- func (t *BaseTraveler) HasMark(label string) bool
- func (tr *BaseTraveler) IsNull() bool
- func (tr *BaseTraveler) IsSignal() bool
- func (t *BaseTraveler) ListMarks() []string
- type CompileOptions
- type Compiler
- type CustomProcGen
- type DataElement
- type DataElementID
- type DataType
- type Deserialize
- type Edge
- type ElementLookup
- type GraphDB
- type GraphElement
- type GraphInterface
- type InPipe
- type LoadData
- type Manager
- type OutPipe
- type Pipeline
- type PipelineState
- type Processor
- type RetrievedData
- type Signal
- type Traveler
- type Vertex
Constants ¶
const ( // StateCustom The Pipeline will be emitting custom data structures StateCustom = 0 // StateVertexList The Pipeline will be emitting a list of vertices StateVertexList = 1 // StateEdgeList The Pipeline will be emitting a list of edges StateEdgeList = 2 // StateRawVertexList The Pipeline will be emitting a list of all vertices, if there is an index // based filter, you can use skip listening and use that StateRawVertexList = 3 // StateRawEdgeList The Pipeline will be emitting a list of all edges, if there is an index // based filter, you can use skip listening and use that StateRawEdgeList = 4 )
These consts mark the type of a Pipeline traveler chan
Variables ¶
This section is empty.
Functions ¶
func DualProcessor ¶
func DualProcessor(ctx context.Context, reqChan chan ElementLookup, load bool, loader LoadData, deserializer Deserialize) chan ElementLookup
func LookupBatcher ¶
func LookupBatcher(req chan ElementLookup, batchSize int, timeout time.Duration) chan []ElementLookup
Types ¶
type BaseTraveler ¶
type BaseTraveler struct { Current *DataElement Marks map[string]*DataElement Selections map[string]*DataElement Aggregation *Aggregate Count uint32 Render interface{} Path []DataElementID Signal *Signal }
Traveler is a query element that traverse the graph
func (*BaseTraveler) AddCurrent ¶
func (t *BaseTraveler) AddCurrent(r *DataElement) Traveler
AddCurrent creates a new copy of the travel with new 'current' value
func (*BaseTraveler) AddMark ¶
func (t *BaseTraveler) AddMark(label string, r *DataElement) Traveler
AddMark adds a result to travels state map using `label` as the name
func (*BaseTraveler) Copy ¶
func (t *BaseTraveler) Copy() Traveler
AddCurrent creates a new copy of the travel with new 'current' value
func (BaseTraveler) GetAggregation ¶
func (t BaseTraveler) GetAggregation() *Aggregate
func (*BaseTraveler) GetCount ¶
func (t *BaseTraveler) GetCount() uint32
func (*BaseTraveler) GetCurrent ¶
func (t *BaseTraveler) GetCurrent() *DataElement
GetCurrent get current result value attached to the traveler
func (*BaseTraveler) GetCurrentID ¶
func (t *BaseTraveler) GetCurrentID() string
func (*BaseTraveler) GetMark ¶
func (t *BaseTraveler) GetMark(label string) *DataElement
GetMark gets stored result in travels state using its label
func (*BaseTraveler) GetPath ¶
func (t *BaseTraveler) GetPath() []DataElementID
func (*BaseTraveler) GetRender ¶
func (t *BaseTraveler) GetRender() interface{}
func (*BaseTraveler) GetSelections ¶
func (t *BaseTraveler) GetSelections() map[string]*DataElement
func (*BaseTraveler) GetSignal ¶
func (tr *BaseTraveler) GetSignal() Signal
func (*BaseTraveler) HasMark ¶
func (t *BaseTraveler) HasMark(label string) bool
HasMark checks to see if a results is stored in a travelers statemap
func (*BaseTraveler) IsNull ¶
func (tr *BaseTraveler) IsNull() bool
func (*BaseTraveler) IsSignal ¶
func (tr *BaseTraveler) IsSignal() bool
func (*BaseTraveler) ListMarks ¶
func (t *BaseTraveler) ListMarks() []string
ListMarks returns the list of marks in a travelers statemap
type CompileOptions ¶
type Compiler ¶
type Compiler interface {
Compile(stmts []*gripql.GraphStatement, opts *CompileOptions) (Pipeline, error)
}
Compiler takes a gripql query and turns it into an executable pipeline
type CustomProcGen ¶
type CustomProcGen interface { GetType() DataType GetProcessor(db GraphInterface, ps PipelineState) (Processor, error) }
type DataElement ¶
type DataElement struct { ID string Label string From, To string Data map[string]interface{} Loaded bool }
DataElement is a single data element
func (*DataElement) ToDict ¶
func (elem *DataElement) ToDict() map[string]interface{}
ToDict converts data element to generic map
func (*DataElement) ToEdge ¶
func (elem *DataElement) ToEdge() *gripql.Edge
ToEdge converts data element to edge
func (*DataElement) ToVertex ¶
func (elem *DataElement) ToVertex() *gripql.Vertex
ToVertex converts data element to vertex
type DataElementID ¶
type DataType ¶
type DataType uint8
DataType is a possible output data type
const ( NoData DataType = iota VertexData EdgeData CountData AggregationData SelectionData RenderData PathData )
DataTypes
func DataTypeString ¶
DataTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func DataTypeValues ¶
func DataTypeValues() []DataType
DataTypeValues returns all values of the enum
func (DataType) IsADataType ¶
IsADataType returns "true" if the value is listed in the enum definition. "false" otherwise
type Deserialize ¶
type Deserialize func(req ElementLookup, data interface{}) ElementLookup
type ElementLookup ¶
ElementLookup request to look up data
func (ElementLookup) IsSignal ¶
func (req ElementLookup) IsSignal() bool
type GraphDB ¶
type GraphDB interface { AddGraph(string) error DeleteGraph(string) error ListGraphs() []string Graph(graphID string) (GraphInterface, error) BuildSchema(ctx context.Context, graphID string, sampleN uint32, random bool) (*gripql.Graph, error) Close() error }
GraphDB is the base interface for graph databases
type GraphElement ¶
func NewGraphElement ¶
func NewGraphElement(g *gripql.GraphElement) *GraphElement
type GraphInterface ¶
type GraphInterface interface { Compiler() Compiler GetTimestamp() string GetVertex(key string, load bool) *Vertex GetEdge(key string, load bool) *Edge AddVertex(vertex []*Vertex) error AddEdge(edge []*Edge) error BulkAdd(<-chan *GraphElement) error DelVertex(key string) error DelEdge(key string) error VertexLabelScan(ctx context.Context, label string) chan string // EdgeLabelScan(ctx context.Context, label string) chan string ListVertexLabels() ([]string, error) ListEdgeLabels() ([]string, error) AddVertexIndex(label string, field string) error DeleteVertexIndex(label string, field string) error GetVertexIndexList() <-chan *gripql.IndexID GetVertexList(ctx context.Context, load bool) <-chan *Vertex GetEdgeList(ctx context.Context, load bool) <-chan *Edge GetVertexChannel(ctx context.Context, req chan ElementLookup, load bool) chan ElementLookup GetOutChannel(ctx context.Context, req chan ElementLookup, load bool, emitNull bool, edgeLabels []string) chan ElementLookup GetInChannel(ctx context.Context, req chan ElementLookup, load bool, emitNull bool, edgeLabels []string) chan ElementLookup GetOutEdgeChannel(ctx context.Context, req chan ElementLookup, load bool, emitNull bool, edgeLabels []string) chan ElementLookup GetInEdgeChannel(ctx context.Context, req chan ElementLookup, load bool, emitNull bool, edgeLabels []string) chan ElementLookup }
GraphInterface is the base Graph data storage interface, the PipeEngine will be able to run queries on a data system backend that implements this interface
type LoadData ¶
type LoadData func(req ElementLookup, load bool) chan interface{}
type Manager ¶
type Manager interface { //Get handle to temporary KeyValue store driver GetTempKV() kvi.KVInterface Cleanup() }
Manager is a resource manager that is passed to processors to allow them ] to make resource requests
type Pipeline ¶
type Pipeline interface { Graph() GraphInterface Processors() []Processor DataType() DataType MarkTypes() map[string]DataType }
Pipeline represents a set of processors
type PipelineState ¶
type Processor ¶
type Processor interface {
Process(ctx context.Context, man Manager, in InPipe, out OutPipe) context.Context
}
Processor is the interface for a step in the pipe engine
type RetrievedData ¶
type RetrievedData struct { Req ElementLookup Data interface{} }
type Traveler ¶
type Traveler interface { IsSignal() bool GetSignal() Signal IsNull() bool GetCurrent() *DataElement GetCurrentID() string AddCurrent(r *DataElement) Traveler Copy() Traveler HasMark(label string) bool GetMark(label string) *DataElement AddMark(label string, r *DataElement) Traveler ListMarks() []string GetSelections() map[string]*DataElement GetRender() interface{} GetPath() []DataElementID GetAggregation() *Aggregate GetCount() uint32 }