rpcsrv

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package rpcsrv contains utilities for serving mesh databases over RPC.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidQuery is returned when a query is invalid.
	ErrInvalidQuery = fmt.Errorf("invalid query")
	// ErrInvalidArgument is returned when an argument is invalid.
	ErrInvalidArgument = fmt.Errorf("invalid argument")
)

Functions

func Serve

func Serve(ctx context.Context, db storage.Provider, cli QueryClient) error

Serve serves database operations over a plugin query stream.

func ServeQuery

func ServeQuery(ctx context.Context, db storage.Provider, req *v1.QueryRequest) *v1.QueryResponse

ServeQuery serves a storage query given a database and a query request.

Types

type QueryClient

type QueryClient interface {
	// The underlying gRPC stream.
	grpc.ClientStream
	// Send sends a query result to the plugin.
	Send(*v1.QueryResponse) error
	// Recv receives a query request from the plugin.
	Recv() (*v1.QueryRequest, error)
}

QueryClient is the interface for a storage query client.

Jump to

Keyboard shortcuts

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