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:
James Shubin
2024-10-13 16:40:50 -04:00
parent b03fdeccae
commit a8c8f09aa3
9 changed files with 67 additions and 0 deletions

View File

@@ -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)