v1beta

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCancelled      = status.Errorf(codes.Canceled, "stream cancelled")
	ErrInvalidRequest = status.Errorf(codes.InvalidArgument, "invalid request")
	ErrQueryFailure   = status.Errorf(codes.Internal, "failed to query graph")
	ErrUpdateFailure  = status.Errorf(codes.Internal, "failed to update graph")
	ErrPruneFailure   = status.Errorf(codes.Internal, "failed to prune graph")
	ErrBFS            = status.Errorf(codes.InvalidArgument, "cannot call breadth-first search with another input request")
	ErrDFS            = status.Errorf(codes.InvalidArgument, "cannot call depth-first search with another input request")
)

Functions

func RegisterLanguageService

func RegisterLanguageService(server *grpc.Server, index IndexService)

func RegisterManifestStorageServiceServer

func RegisterManifestStorageServiceServer(server *grpc.Server, graphStore graphstore.GraphStoreClient, index IndexService)

func RegisterModuleServiceServer

func RegisterModuleServiceServer(server *grpc.Server, graphStore graphstore.GraphStoreClient, index IndexService)

func RegisterSourceServiceServer

func RegisterSourceServiceServer(server *grpc.Server, graphStore graphstore.GraphStoreClient, index IndexService)

func RegisterTraversalServiceServer

func RegisterTraversalServiceServer(server *grpc.Server, graphStore graphstore.GraphStoreClient)

Types

type DefaultKind

type DefaultKind = string

TODO: move this to internal to be shared between indexer and tracker

const (
	ProviderDefaultKind   DefaultKind = "provider"
	RepositoryDefaultKind DefaultKind = "repository"
	ArtifactDefaultKind   DefaultKind = "artifact"
)

type Index

type Index struct {
	Kind  string `gorm:"column:kind;varchar(255);primaryKey;"`
	Field string `gorm:"column:field;varchar(255);primaryKey;"`
	Value string `gorm:"column:value;varchar(4096);primaryKey;index;"`
	Key   string `gorm:"column:key;varchar(64);primaryKey;"`
}

Index defines a generic structure that allows us to index data on structures. The general format for the table is as follows. Note, we currently don't support querying across multiple fields (ie. language=go and name like ...) but I think we can add support for something like that later on? For now, we can filter in memory as this is already much better to navigate than before.

Kind      Field     Value                             Key
----      -----     -----                             ---
Module    Name      github.com/depscloud/depscloud    K1 (node)
Depends   Version   v0.1.0                            K3 (edge)

func (*Index) TableName

func (i *Index) TableName() string

type IndexService

type IndexService interface {
	Index(ctx context.Context, fields []*Index) error
	Distinct(ctx context.Context, filter *Index) ([]string, error)
	Query(ctx context.Context, filter *Index) ([]*Index, error)
}

func NewSQLIndexService

func NewSQLIndexService(rw, ro *gorm.DB) IndexService

NewSQLIndexService constructs an IndexService that's backed by an SQL database.

type NodeOrEdge

type NodeOrEdge interface {
	GetBody() *anypb.Any
}

NodeOrEdge is a handy interface for converting any datatype from a node or edge payload.

type Stack

type Stack []*v1beta.SearchRequest

func (*Stack) Pop

func (s *Stack) Pop() *v1beta.SearchRequest

func (*Stack) Push

func (s *Stack) Push(request *v1beta.SearchRequest)

Jump to

Keyboard shortcuts

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