memory

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryGraph

type InMemoryGraph struct {
	// contains filtered or unexported fields
}

InMemoryGraph implements an in-memory link graph that can be concurrently accessed by multiple clients.

func NewInMemoryGraph

func NewInMemoryGraph() *InMemoryGraph

NewInMemoryGraph creates a new in-memory link graph.

func (*InMemoryGraph) Edges

func (s *InMemoryGraph) 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 updated before the provided timestamp.

func (s *InMemoryGraph) FindLink(id uuid.UUID) (*graph.Link, error)

FindLink looks up a link by its ID.

func (s *InMemoryGraph) Links(fromID, toID uuid.UUID, retrievedBefore time.Time) (graph.LinkIterator, error)

Links returns an iterator for the set of links whose IDs belong to the [fromID, toID) range and were retrieved before the provided timestamp.

func (*InMemoryGraph) RemoveStaleEdges

func (s *InMemoryGraph) 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 (*InMemoryGraph) UpsertEdge

func (s *InMemoryGraph) UpsertEdge(edge *graph.Edge) error

UpsertEdge creates a new edge or updates an existing edge.

func (s *InMemoryGraph) 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