Documentation ¶
Index ¶
- type CockroachDBGraph
- func (c *CockroachDBGraph) Close() error
- func (c *CockroachDBGraph) Edges(fromID, toID uuid.UUID, updatedBefore time.Time) (graph.EdgeIterator, error)
- func (c *CockroachDBGraph) FindLink(id uuid.UUID) (*graph.Link, error)
- func (c *CockroachDBGraph) Links(fromID, toID uuid.UUID, accessedBefore time.Time) (graph.LinkIterator, error)
- func (c *CockroachDBGraph) RemoveStaleEdges(fromID uuid.UUID, updatedBefore time.Time) error
- func (c *CockroachDBGraph) UpsertEdge(edge *graph.Edge) error
- func (c *CockroachDBGraph) UpsertLink(link *graph.Link) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CockroachDBGraph ¶
type CockroachDBGraph struct {
// contains filtered or unexported fields
}
CockroachDBGraph implements a graph that persists its links and edges to a cockroachdb instance.
func NewCockroachDbGraph ¶
func NewCockroachDbGraph(dsn string) (*CockroachDBGraph, error)
NewCockroachDbGraph returns a CockroachDbGraph instance that connects to the cockroachdb instance specified by dsn.
func (*CockroachDBGraph) Close ¶
func (c *CockroachDBGraph) Close() error
Close terminates the connection to the backing cockroachdb instance.
func (*CockroachDBGraph) Edges ¶
func (c *CockroachDBGraph) Edges(fromID, toID uuid.UUID, updatedBefore time.Time) (graph.EdgeIterator, error)
Edges returns an iterator for the set of edges whose source vertex IDs belong to the [fromID, toID) range and were last updated before the provided value.
func (*CockroachDBGraph) Links ¶
func (c *CockroachDBGraph) Links(fromID, toID uuid.UUID, accessedBefore time.Time) (graph.LinkIterator, error)
Links returns an iterator for the set of links whose IDs belong to the [fromID, toID) range and were last accessed before the provided value.
func (*CockroachDBGraph) RemoveStaleEdges ¶
RemoveStaleEdges removes any edge that originates from the specified link ID and was updated before the specified timestamp.
func (*CockroachDBGraph) UpsertEdge ¶
func (c *CockroachDBGraph) UpsertEdge(edge *graph.Edge) error
UpsertEdge creates a new edge or updates an existing edge.
func (*CockroachDBGraph) UpsertLink ¶
func (c *CockroachDBGraph) UpsertLink(link *graph.Link) error
UpsertLink creates a new link or updates an existing link.