rpcdb

package
v1.26.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package rpcdb provides the ZAP-native database RPC types — the shapes that flow over the wire when a VM plugin (separate process) reads/writes the host's database via the ZAP transport.

This package is the single source of truth for the on-the-wire types; the grpc-tagged variant under proto/pb/rpcdb is generated from these shapes and is mutually exclusive with the ZAP default (you build with either `-tags=grpc` or no tag, never both).

The actual storage backend on the server side is luxfi/database — which is currently zapdb under the hood. The same interface is presented to plugin clients regardless of which DB engine the host runs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseRequest

type CloseRequest struct{}

CloseRequest is the wire payload for Database.Close.

type CloseResponse

type CloseResponse struct {
	Err Error
}

CloseResponse is the wire reply for Database.Close.

type CompactRequest

type CompactRequest struct {
	Start []byte
	Limit []byte
}

CompactRequest is the wire payload for Database.Compact.

type CompactResponse

type CompactResponse struct {
	Err Error
}

CompactResponse is the wire reply for Database.Compact.

type DeleteRequest

type DeleteRequest struct {
	Key []byte
}

DeleteRequest is the wire payload for Database.Delete.

type DeleteResponse

type DeleteResponse struct {
	Err Error
}

DeleteResponse is the wire reply for Database.Delete.

type Error

type Error int32

Error is the on-the-wire error code returned by every database RPC.

const (
	// Error_ERROR_UNSPECIFIED is the success / no-error sentinel.
	Error_ERROR_UNSPECIFIED Error = 0
	// Error_ERROR_CLOSED maps to database.ErrClosed.
	Error_ERROR_CLOSED Error = 1
	// Error_ERROR_NOT_FOUND maps to database.ErrNotFound.
	Error_ERROR_NOT_FOUND Error = 2
)

func (Error) String

func (e Error) String() string

type GetRequest

type GetRequest struct {
	Key []byte
}

GetRequest is the wire payload for Database.Get.

type GetResponse

type GetResponse struct {
	Value []byte
	Err   Error
}

GetResponse is the wire reply for Database.Get.

type HasRequest

type HasRequest struct {
	Key []byte
}

HasRequest is the wire payload for Database.Has.

type HasResponse

type HasResponse struct {
	Has bool
	Err Error
}

HasResponse is the wire reply for Database.Has.

type HealthCheckResponse

type HealthCheckResponse struct {
	Details []byte
}

HealthCheckResponse is the wire reply for Database.HealthCheck.

type IteratorErrorRequest

type IteratorErrorRequest struct {
	Id uint64
}

IteratorErrorRequest is the wire payload for Database.IteratorError.

type IteratorErrorResponse

type IteratorErrorResponse struct {
	Err Error
}

IteratorErrorResponse is the wire reply for Database.IteratorError.

type IteratorNextRequest

type IteratorNextRequest struct {
	Id uint64
}

IteratorNextRequest is the wire payload for Database.IteratorNext.

type IteratorNextResponse

type IteratorNextResponse struct {
	Data []*PutRequest
}

IteratorNextResponse is the wire reply for Database.IteratorNext. Data is the next batch of (key, value) pairs to read; an empty batch indicates the iterator has been exhausted.

type IteratorReleaseRequest

type IteratorReleaseRequest struct {
	Id uint64
}

IteratorReleaseRequest is the wire payload for Database.IteratorRelease.

type IteratorReleaseResponse

type IteratorReleaseResponse struct {
	Err Error
}

IteratorReleaseResponse is the wire reply for Database.IteratorRelease.

type NewIteratorWithStartAndPrefixRequest

type NewIteratorWithStartAndPrefixRequest struct {
	Start  []byte
	Prefix []byte
}

NewIteratorWithStartAndPrefixRequest is the wire payload for Database.NewIteratorWithStartAndPrefix.

type NewIteratorWithStartAndPrefixResponse

type NewIteratorWithStartAndPrefixResponse struct {
	Id uint64
}

NewIteratorWithStartAndPrefixResponse is the wire reply for Database.NewIteratorWithStartAndPrefix.

type PutRequest

type PutRequest struct {
	Key   []byte
	Value []byte
}

PutRequest is the wire payload for Database.Put (and the PUT entries in WriteBatch / IteratorNext).

type PutResponse

type PutResponse struct {
	Err Error
}

PutResponse is the wire reply for Database.Put.

type WriteBatchRequest

type WriteBatchRequest struct {
	Puts    []*PutRequest
	Deletes []*DeleteRequest
}

WriteBatchRequest is the wire payload for Database.WriteBatch.

type WriteBatchResponse

type WriteBatchResponse struct {
	Err Error
}

WriteBatchResponse is the wire reply for Database.WriteBatch.

Jump to

Keyboard shortcuts

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