gapi: Plumb through a URI mechanism
This is at least a stop-gap until we redo the whole filesystem API mess. I think golang is partly to blame because they don't have proper API's merged yet.
This commit is contained in:
@@ -77,6 +77,13 @@ func (obj *GAPI) Init(data *gapi.Data) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Info returns some data about the GAPI implementation.
|
||||
func (obj *GAPI) Info() *gapi.InfoResult {
|
||||
return &gapi.InfoResult{
|
||||
URI: "",
|
||||
}
|
||||
}
|
||||
|
||||
// Graph returns a current Graph.
|
||||
func (obj *GAPI) Graph() (*pgraph.Graph, error) {
|
||||
if !obj.initialized {
|
||||
|
||||
10
gapi/gapi.go
10
gapi/gapi.go
@@ -120,6 +120,13 @@ type Next struct {
|
||||
Err error // if something goes wrong (use with or without exit!)
|
||||
}
|
||||
|
||||
// InfoResult is some data that a GAPI can return on request.
|
||||
type InfoResult struct {
|
||||
// URI is the FS URI that we pass around everywhere.
|
||||
// TODO: can this be deprecated?
|
||||
URI string
|
||||
}
|
||||
|
||||
// GAPI is a Graph API that represents incoming graphs and change streams. It is
|
||||
// the frontend interface that needs to be implemented to use the engine.
|
||||
type GAPI interface {
|
||||
@@ -132,6 +139,9 @@ type GAPI interface {
|
||||
// Init initializes the GAPI and passes in some useful data.
|
||||
Init(*Data) error
|
||||
|
||||
// Info returns some data about the GAPI implementation.
|
||||
Info() *InfoResult
|
||||
|
||||
// Graph returns the most recent pgraph. This is called by the engine on
|
||||
// every event from Next().
|
||||
Graph() (*pgraph.Graph, error)
|
||||
|
||||
Reference in New Issue
Block a user