cdb

package
v0.0.0-...-8b501b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 (c *CockroachDBGraph) FindLink(id uuid.UUID) (*graph.Link, error)

FindLink looks up a link by its ID.

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

func (c *CockroachDBGraph) RemoveStaleEdges(fromID uuid.UUID, updatedBefore time.Time) error

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 (c *CockroachDBGraph) UpsertLink(link *graph.Link) error

UpsertLink creates a new link or updates an existing link.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL