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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphClient

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

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

func NewGraphClient

func NewGraphClient(ctx context.Context, rpcClient proto.GraphClient) *GraphClient

NewGraphClient 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 server.

func (*GraphClient) Edges

func (c *GraphClient) Edges(fromID, toID uuid.UUID, updatedBefore time.Time) (graph.EdgeIterator, error)
func (c *GraphClient) Links(fromID, toID uuid.UUID, accessedBefore time.Time) (graph.LinkIterator, error)

func (*GraphClient) RemoveStaleEdges

func (c *GraphClient) RemoveStaleEdges(from uuid.UUID, updatedBefore time.Time) error

func (*GraphClient) UpsertEdge

func (c *GraphClient) UpsertEdge(edge *graph.Edge) error
func (c *GraphClient) UpsertLink(link *graph.Link) error

type GraphServer

type GraphServer struct {
	proto.UnimplementedGraphServer
	// contains filtered or unexported fields
}

GraphServer provides a gRPC layer for accessing a graph.

func NewGraphServer

func NewGraphServer(g graph.Graph) *GraphServer

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

func (*GraphServer) Edges

func (s *GraphServer) Edges(idRange *proto.Range, w proto.Graph_EdgesServer) error

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

func (s *GraphServer) Links(idRange *proto.Range, w proto.Graph_LinksServer) error

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

func (*GraphServer) RemoveStaleEdges

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

func (s *GraphServer) UpsertEdge(_ context.Context, req *proto.Edge) (*proto.Edge, error)
func (s *GraphServer) UpsertLink(_ context.Context, req *proto.Link) (*proto.Link, error)

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