rpcdb

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Overview

Package rpcdb is the transport-agnostic Layer B service spec for the remote `database.Database` service.

Layered topology:

Layer A — wire framing                   (github.com/luxfi/api/zap)
Layer B — service spec (this package)    (github.com/luxfi/protocol/rpcdb)
Layer C — service impl + transport       (github.com/luxfi/node/db/rpcdb)

This package contains ONLY the data carriers (HasRequest/HasResponse /…) and the wire-typed Error enum. Every transport adapter — gRPC, ZAP, future ones — depends on this package and stays orthogonal to every other transport.

The actual storage backend on the server side is the `github.com/luxfi/database`.Database interface; the canonical Service + transport adapters live in github.com/luxfi/node/db/rpcdb.

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. Every transport carries it as a single byte (or proto enum, depending on transport) and maps it back to a `database` sentinel on the caller's side.

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