Commit Graph

3 Commits

Author SHA1 Message Date
Elle Mouton
9854bad720 graph: add contexts to the ReadOnlyGraph interface
Since the GraphSource interface may be satisfied by an RPC connection,
it is best practice to pass a context through to any call in the
interface.

The ChanGraphSource implementation, which uses a kvdb backend, does not
make use of the ctx. Any call-sites are for now given a `context.TODO()`
which will all be addressed in follow up commits.
2024-11-28 14:52:48 +02:00
Elle Mouton
aa2480464b graph: add ReadOnlyGraph interface to GraphSource interface
In this commit, we take the existing graphsession.ReadyOnlyGraph
interface and remove its usage of a kvdb.RTx and replace it with a more
abstract `RTx` interface type.

The new GraphSource interface is expanded to include the
graphsession.ReadOnlyGraph interface and the implementation of it,
DBSource, is expanded to include the new methods. It converts the
given RTx to the underlying kvdb read transaction where needed.
2024-11-28 14:52:48 +02:00
Elle Mouton
755065b6ab graph: rename directory from graphsession to session
The package name is kept the same. So this is just for less stuttering
at a path level.
2024-11-28 14:52:48 +02:00