graph

package
v0.0.0-...-e97be17 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = xerrors.New("not found")

	// ErrUnknownEdgeLinks is returned when attempting to create an edge
	// with an invalid source and/or destination ID
	ErrUnknownEdgeLinks = xerrors.New("unknown source and/or destination for edge")
)

Functions

This section is empty.

Types

type Edge

type Edge struct {
	ID        uuid.UUID
	Src       uuid.UUID
	Dst       uuid.UUID
	UpdatedAt time.Time
}

type EdgeIterator

type EdgeIterator interface {
	Iterator
	Edge() *Edge
}

type Graph

type Graph interface {
	UpsertLink(*Link) error
	FindLink(uuid.UUID) (*Link, error)

	UpsertEdge(*Edge) error
	RemoveStaleEdges(fromID uuid.UUID, updatedBefore time.Time) error

	Links(fromID, toID uuid.UUID, retreviedBefore time.Time) (LinkIterator, error)
	Edges(fromID, toID uuid.UUID, updatedBefore time.Time) (EdgeIterator, error)
}

type Iterator

type Iterator interface {
	Next() bool
	Error() error
	Close() error
}
type Link struct {
	ID          uuid.UUID
	URL         string
	RetreivedAt time.Time
}

type LinkIterator

type LinkIterator interface {
	Iterator
	Link() *Link
}

Directories

Path Synopsis
store
cdb

Jump to

Keyboard shortcuts

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