Documentation ¶
Overview ¶
Package xrefs contains a simple implementation of the xrefs.Service interface backed by a graphstore.Service.
Index ¶
- func EnsureReverseEdges(ctx context.Context, gs graphstore.Service) error
- type GraphStoreService
- func (g *GraphStoreService) Decorations(ctx context.Context, req *xpb.DecorationsRequest) (*xpb.DecorationsReply, error)
- func (g *GraphStoreService) Edges(ctx context.Context, req *xpb.EdgesRequest) (*xpb.EdgesReply, error)
- func (g *GraphStoreService) Nodes(ctx context.Context, req *xpb.NodesRequest) (*xpb.NodesReply, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureReverseEdges ¶
func EnsureReverseEdges(ctx context.Context, gs graphstore.Service) error
EnsureReverseEdges checks if gs contains reverse edges. If it doesn't, it will scan gs for all forward edges, adding a reverse for each back into the GraphStore. This is necessary for a GraphStoreService to work properly.
Types ¶
type GraphStoreService ¶
type GraphStoreService struct {
// contains filtered or unexported fields
}
A GraphStoreService partially implements the xrefs.Service interface directly using a graphstore.Service with stored reverse edges. This is a low-performance, simple alternative to creating the serving Table representation. TODO(schroederc): parallelize GraphStore calls
func NewGraphStoreService ¶
func NewGraphStoreService(gs graphstore.Service) *GraphStoreService
NewGraphStoreService returns a new GraphStoreService given an existing graphstore.Service.
func (*GraphStoreService) Decorations ¶
func (g *GraphStoreService) Decorations(ctx context.Context, req *xpb.DecorationsRequest) (*xpb.DecorationsReply, error)
Decorations implements part of the Service interface.
func (*GraphStoreService) Edges ¶
func (g *GraphStoreService) Edges(ctx context.Context, req *xpb.EdgesRequest) (*xpb.EdgesReply, error)
Edges implements part of the Service interface.
func (*GraphStoreService) Nodes ¶
func (g *GraphStoreService) Nodes(ctx context.Context, req *xpb.NodesRequest) (*xpb.NodesReply, error)
Nodes implements part of the Service interface.