cdb

package
v0.0.0-...-2eece4d Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 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 links & edges to a cockroachDB

func NewCockroachDBGraph

func NewCockroachDBGraph(dsn string) (*CockroachDBGraph, error)

NewCockroachDBGraph returns a new CockroachDBGraph instance that connects via provided dsn

func (*CockroachDBGraph) Close

func (c *CockroachDBGraph) Close() error

Close closes the CockroachDB connection or returns an error

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 and returns

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 one and persists

Jump to

Keyboard shortcuts

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