Documentation ¶
Index ¶
- type Graph
- func (c *Graph) Close() error
- func (c *Graph) Edges(fromID, toID uuid.UUID, updatedBefore time.Time) (graph.EdgeIterator, error)
- func (c *Graph) FindLink(id uuid.UUID) (*graph.Link, error)
- func (c *Graph) Links(fromID, toID uuid.UUID, accessedBefore time.Time) (graph.LinkIterator, error)
- func (c *Graph) RemoveStaleEdges(fromID uuid.UUID, updatedBefore time.Time) error
- func (c *Graph) UpsertEdge(edge *graph.Edge) error
- func (c *Graph) UpsertLink(link *graph.Link) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph implements a graph that persists its links and edges to a cockroachdb instance.
func NewGraph ¶
NewGraph returns a Graph instance that connects to the cockroachdb instance specified by dsn.
func (*Graph) Edges ¶
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 (*Graph) Links ¶
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 (*Graph) RemoveStaleEdges ¶
RemoveStaleEdges removes any edge that originates from the specified link ID and was updated before the specified timestamp.
func (*Graph) UpsertEdge ¶
UpsertEdge creates a new edge or updates an existing edge.