graphapi

package
v0.0.0-...-7b67181 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkGraphClient

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

LinkGraphClient provides an API compatible with the graph.Graph interface for accessing graph instances exposed by a remote gRPC server.

func NewLinkGraphClient

func NewLinkGraphClient(ctx context.Context, rpcClient proto.LinkGraphClient) *LinkGraphClient

NewLinkGraphClient returns a new client instance that implements a subset of the graph.Graph interface by delegating methods to a graph instance exposed by a remote gRPC sever.

func (*LinkGraphClient) Edges

func (c *LinkGraphClient) 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 *LinkGraphClient) 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 (*LinkGraphClient) RemoveStaleEdges

func (c *LinkGraphClient) RemoveStaleEdges(from 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 (*LinkGraphClient) UpsertEdge

func (c *LinkGraphClient) UpsertEdge(edge *graph.Edge) error

UpsertEdge creates a new edge or updates an existing edge.

func (c *LinkGraphClient) UpsertLink(link *graph.Link) error

UpsertLink creates a new link or updates an existing link.

type LinkGraphServer

type LinkGraphServer struct {
	proto.UnimplementedLinkGraphServer
	// contains filtered or unexported fields
}

LinkGraphServer provides a gRPC layer for accessing a link graph.

func NewLinkGraphServer

func NewLinkGraphServer(g graph.Graph) *LinkGraphServer

NewLinkGraphServer returns a new server instance that uses the provided graph as its backing store.

func (*LinkGraphServer) Edges

Edges streams the set of edges whose IDs belong to the specified partition range and were updated before the specified timestamp.

Links streams the set of links whose IDs belong to the specified partition range and were accessed before the specified timestamp.

func (*LinkGraphServer) RemoveStaleEdges

func (s *LinkGraphServer) RemoveStaleEdges(_ context.Context, req *proto.RemoveStaleEdgesQuery) (*empty.Empty, error)

RemoveStaleEdges removes any edge that originates from the specified link ID and was updated before the specified timestamp.

func (*LinkGraphServer) UpsertEdge

func (s *LinkGraphServer) UpsertEdge(_ context.Context, req *proto.Edge) (*proto.Edge, error)

UpsertEdge inserts or updates an edge.

func (s *LinkGraphServer) UpsertLink(_ context.Context, req *proto.Link) (*proto.Link, error)

UpsertLink inserts or updates a link.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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