Documentation ¶
Overview ¶
Package server contains code for serving the Grip API.
Index ¶
- func NewMarshaler() runtime.Marshaler
- func StartDriver(d config.DriverConfig, sources map[string]gripper.GRIPSourceClient) (gdbi.GraphDB, error)
- type EndpointSetupFunc
- type GripServer
- func (server *GripServer) AddEdge(ctx context.Context, elem *gripql.GraphElement) (*gripql.EditResult, error)
- func (server *GripServer) AddEndpoint(name string, path string) error
- func (server *GripServer) AddGraph(ctx context.Context, elem *gripql.GraphID) (*gripql.EditResult, error)
- func (server *GripServer) AddIndex(ctx context.Context, idx *gripql.IndexID) (*gripql.EditResult, error)
- func (server *GripServer) AddMapping(ctx context.Context, req *gripql.Graph) (*gripql.EditResult, error)
- func (server *GripServer) AddSchema(ctx context.Context, req *gripql.Graph) (*gripql.EditResult, error)
- func (server *GripServer) AddVertex(ctx context.Context, elem *gripql.GraphElement) (*gripql.EditResult, error)
- func (server *GripServer) BulkAdd(stream gripql.Edit_BulkAddServer) error
- func (server *GripServer) ClosePlugins()
- func (server *GripServer) DeleteEdge(ctx context.Context, elem *gripql.ElementID) (*gripql.EditResult, error)
- func (server *GripServer) DeleteGraph(ctx context.Context, elem *gripql.GraphID) (*gripql.EditResult, error)
- func (server *GripServer) DeleteIndex(ctx context.Context, idx *gripql.IndexID) (*gripql.EditResult, error)
- func (server *GripServer) DeleteJob(ctx context.Context, job *gripql.QueryJob) (*gripql.JobStatus, error)
- func (server *GripServer) DeleteVertex(ctx context.Context, elem *gripql.ElementID) (*gripql.EditResult, error)
- func (server *GripServer) GetEdge(ctx context.Context, elem *gripql.ElementID) (*gripql.Edge, error)
- func (server *GripServer) GetJob(ctx context.Context, job *gripql.QueryJob) (*gripql.JobStatus, error)
- func (server *GripServer) GetMapping(ctx context.Context, elem *gripql.GraphID) (*gripql.Graph, error)
- func (server *GripServer) GetSchema(ctx context.Context, elem *gripql.GraphID) (*gripql.Graph, error)
- func (server *GripServer) GetTimestamp(ctx context.Context, elem *gripql.GraphID) (*gripql.Timestamp, error)
- func (server *GripServer) GetVertex(ctx context.Context, elem *gripql.ElementID) (*gripql.Vertex, error)
- func (server *GripServer) ListDrivers(context.Context, *gripql.Empty) (*gripql.ListDriversResponse, error)
- func (server *GripServer) ListGraphs(ctx context.Context, empty *gripql.Empty) (*gripql.ListGraphsResponse, error)
- func (server *GripServer) ListIndices(ctx context.Context, idx *gripql.GraphID) (*gripql.ListIndicesResponse, error)
- func (server *GripServer) ListJobs(graph *gripql.GraphID, srv gripql.Job_ListJobsServer) error
- func (server *GripServer) ListLabels(ctx context.Context, idx *gripql.GraphID) (*gripql.ListLabelsResponse, error)
- func (server *GripServer) ListPlugins(context.Context, *gripql.Empty) (*gripql.ListPluginsResponse, error)
- func (server *GripServer) ListTables(empty *gripql.Empty, srv gripql.Query_ListTablesServer) error
- func (server *GripServer) ResumeJob(query *gripql.ExtendQuery, srv gripql.Job_ResumeJobServer) error
- func (server *GripServer) SampleSchema(ctx context.Context, elem *gripql.GraphID) (*gripql.Graph, error)
- func (server *GripServer) SearchJobs(query *gripql.GraphQuery, srv gripql.Job_SearchJobsServer) error
- func (server *GripServer) Serve(pctx context.Context) error
- func (server *GripServer) StartPlugin(ctx context.Context, config *gripql.PluginConfig) (*gripql.PluginStatus, error)
- func (server *GripServer) Submit(ctx context.Context, query *gripql.GraphQuery) (*gripql.QueryJob, error)
- func (server *GripServer) Traversal(query *gripql.GraphQuery, queryServer gripql.Query_TraversalServer) error
- func (server *GripServer) ViewJob(job *gripql.QueryJob, srv gripql.Job_ViewJobServer) error
- type MarshalClean
- func (mclean *MarshalClean) ContentType(i interface{}) string
- func (mclean *MarshalClean) Marshal(v interface{}) ([]byte, error)
- func (mclean *MarshalClean) NewDecoder(r io.Reader) runtime.Decoder
- func (mclean *MarshalClean) NewEncoder(w io.Writer) runtime.Encoder
- func (mclean *MarshalClean) Unmarshal(data []byte, v interface{}) error
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMarshaler ¶
func StartDriver ¶
func StartDriver(d config.DriverConfig, sources map[string]gripper.GRIPSourceClient) (gdbi.GraphDB, error)
StartDriver: based on string entry in config file, figure out which driver to initialize
Types ¶
type GripServer ¶
type GripServer struct { gripql.UnimplementedQueryServer gripql.UnimplementedEditServer gripql.UnimplementedJobServer gripql.UnimplementedConfigureServer // contains filtered or unexported fields }
GripServer is a GRPC based grip server
func NewGripServer ¶
func NewGripServer(conf *config.Config, baseDir string, drivers map[string]gdbi.GraphDB) (*GripServer, error)
NewGripServer initializes a GRPC server to connect to the graph store
func (*GripServer) AddEdge ¶
func (server *GripServer) AddEdge(ctx context.Context, elem *gripql.GraphElement) (*gripql.EditResult, error)
AddEdge adds an edge to the graph
func (*GripServer) AddEndpoint ¶
func (server *GripServer) AddEndpoint(name string, path string) error
func (*GripServer) AddGraph ¶
func (server *GripServer) AddGraph(ctx context.Context, elem *gripql.GraphID) (*gripql.EditResult, error)
AddGraph creates a new graph on the server
func (*GripServer) AddIndex ¶
func (server *GripServer) AddIndex(ctx context.Context, idx *gripql.IndexID) (*gripql.EditResult, error)
AddIndex adds a new index
func (*GripServer) AddMapping ¶
func (server *GripServer) AddMapping(ctx context.Context, req *gripql.Graph) (*gripql.EditResult, error)
AddMapping caches a graph schema on the server
func (*GripServer) AddSchema ¶
func (server *GripServer) AddSchema(ctx context.Context, req *gripql.Graph) (*gripql.EditResult, error)
AddSchema caches a graph schema on the server
func (*GripServer) AddVertex ¶
func (server *GripServer) AddVertex(ctx context.Context, elem *gripql.GraphElement) (*gripql.EditResult, error)
AddVertex adds a vertex to the graph
func (*GripServer) BulkAdd ¶
func (server *GripServer) BulkAdd(stream gripql.Edit_BulkAddServer) error
BulkAdd a stream of inputs and loads them into the graph
func (*GripServer) ClosePlugins ¶
func (server *GripServer) ClosePlugins()
func (*GripServer) DeleteEdge ¶
func (server *GripServer) DeleteEdge(ctx context.Context, elem *gripql.ElementID) (*gripql.EditResult, error)
DeleteEdge deletes an edge from the graph server
func (*GripServer) DeleteGraph ¶
func (server *GripServer) DeleteGraph(ctx context.Context, elem *gripql.GraphID) (*gripql.EditResult, error)
DeleteGraph deletes a graph
func (*GripServer) DeleteIndex ¶
func (server *GripServer) DeleteIndex(ctx context.Context, idx *gripql.IndexID) (*gripql.EditResult, error)
DeleteIndex removes an index from the server
func (*GripServer) DeleteVertex ¶
func (server *GripServer) DeleteVertex(ctx context.Context, elem *gripql.ElementID) (*gripql.EditResult, error)
DeleteVertex deletes a vertex from the server
func (*GripServer) GetEdge ¶
func (server *GripServer) GetEdge(ctx context.Context, elem *gripql.ElementID) (*gripql.Edge, error)
GetEdge returns an edge given a gripql.Element
func (*GripServer) GetMapping ¶
func (server *GripServer) GetMapping(ctx context.Context, elem *gripql.GraphID) (*gripql.Graph, error)
GetMapping returns the schema of a specific graph in the database
func (*GripServer) GetSchema ¶
func (server *GripServer) GetSchema(ctx context.Context, elem *gripql.GraphID) (*gripql.Graph, error)
GetSchema returns the schema of a specific graph in the database
func (*GripServer) GetTimestamp ¶
func (server *GripServer) GetTimestamp(ctx context.Context, elem *gripql.GraphID) (*gripql.Timestamp, error)
GetTimestamp returns the update timestamp of a graph
func (*GripServer) GetVertex ¶
func (server *GripServer) GetVertex(ctx context.Context, elem *gripql.ElementID) (*gripql.Vertex, error)
GetVertex returns a vertex given a gripql.Element
func (*GripServer) ListDrivers ¶
func (server *GripServer) ListDrivers(context.Context, *gripql.Empty) (*gripql.ListDriversResponse, error)
func (*GripServer) ListGraphs ¶
func (server *GripServer) ListGraphs(ctx context.Context, empty *gripql.Empty) (*gripql.ListGraphsResponse, error)
ListGraphs returns a list of graphs managed by the driver
func (*GripServer) ListIndices ¶
func (server *GripServer) ListIndices(ctx context.Context, idx *gripql.GraphID) (*gripql.ListIndicesResponse, error)
ListIndices lists avalible indices from a graph
func (*GripServer) ListJobs ¶
func (server *GripServer) ListJobs(graph *gripql.GraphID, srv gripql.Job_ListJobsServer) error
func (*GripServer) ListLabels ¶
func (server *GripServer) ListLabels(ctx context.Context, idx *gripql.GraphID) (*gripql.ListLabelsResponse, error)
ListLabels lists the vertex and edge labels in a graph
func (*GripServer) ListPlugins ¶
func (server *GripServer) ListPlugins(context.Context, *gripql.Empty) (*gripql.ListPluginsResponse, error)
func (*GripServer) ListTables ¶
func (server *GripServer) ListTables(empty *gripql.Empty, srv gripql.Query_ListTablesServer) error
ListTables returns list of all tables that are found in plugin system
func (*GripServer) ResumeJob ¶
func (server *GripServer) ResumeJob(query *gripql.ExtendQuery, srv gripql.Job_ResumeJobServer) error
func (*GripServer) SampleSchema ¶
func (server *GripServer) SampleSchema(ctx context.Context, elem *gripql.GraphID) (*gripql.Graph, error)
GetSchema returns the schema of a specific graph in the database
func (*GripServer) SearchJobs ¶
func (server *GripServer) SearchJobs(query *gripql.GraphQuery, srv gripql.Job_SearchJobsServer) error
func (*GripServer) Serve ¶
func (server *GripServer) Serve(pctx context.Context) error
Serve starts the server and does not block. This will open TCP ports for both RPC and HTTP.
func (*GripServer) StartPlugin ¶
func (server *GripServer) StartPlugin(ctx context.Context, config *gripql.PluginConfig) (*gripql.PluginStatus, error)
func (*GripServer) Submit ¶
func (server *GripServer) Submit(ctx context.Context, query *gripql.GraphQuery) (*gripql.QueryJob, error)
func (*GripServer) Traversal ¶
func (server *GripServer) Traversal(query *gripql.GraphQuery, queryServer gripql.Query_TraversalServer) error
Traversal parses a traversal request and streams the results back
func (*GripServer) ViewJob ¶
func (server *GripServer) ViewJob(job *gripql.QueryJob, srv gripql.Job_ViewJobServer) error
type MarshalClean ¶
type MarshalClean struct {
// contains filtered or unexported fields
}
MarshalClean is a shim class to 'fix' outgoing streamed messages in the default implementation, grpc-gateway wraps the individual messages of the stream with a {"result" : <value>}. The cleaner idendifies that and removes the wrapper
func (*MarshalClean) ContentType ¶
func (mclean *MarshalClean) ContentType(i interface{}) string
ContentType return content type of marshler
func (*MarshalClean) Marshal ¶
func (mclean *MarshalClean) Marshal(v interface{}) ([]byte, error)
Marshal serializes v into a JSON encoded byte array. If v is of type `proto.Message` the then field "result" is extracted and returned by itself. This is mainly to get around a weird behavior of the GRPC gateway streaming output
func (*MarshalClean) NewDecoder ¶
func (mclean *MarshalClean) NewDecoder(r io.Reader) runtime.Decoder
NewDecoder shims runtime.Marshaler.NewDecoder
func (*MarshalClean) NewEncoder ¶
func (mclean *MarshalClean) NewEncoder(w io.Writer) runtime.Encoder
NewEncoder shims runtime.Marshaler.NewEncoder
func (*MarshalClean) Unmarshal ¶
func (mclean *MarshalClean) Unmarshal(data []byte, v interface{}) error
Unmarshal shims runtime.Marshaler.Unmarshal