database

package
v0.0.0-...-531f21a Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch interface {
	Writer

	// Commit writes all changes buffered in the batch to the underlying database.
	Commit() error

	// Close closes the batch without committing it.
	Close() error
}

Batch is a set of write-only operations. The operations are buffered until Commit is explicitely called.

type Batcher

type Batcher interface {
	NewBatch() Batch
}

Batcher defines batch write operations for a key-value database.

type Database

type Database interface {
	Reader
	Writer
	Batcher
	Iterable
	io.Closer
}

Database is all interfaces for underlying key-value database.

type Iterable

type Iterable interface {
	NewIterator(prefix []byte, start []byte) (Iterator, error)
}

Iterable defines new iterator creation for a key-value database.

type Iterator

type Iterator interface {
	Next() bool
	Key() []byte
	Value() []byte
	Error() error
	Close() error
}

Iterator defines the interface for iterating over key-value pairs in the database.

type Reader

type Reader interface {
	Has(key []byte) (bool, error)
	Get(key []byte) ([]byte, bool, error)
}

Reader defines read-only operations for a key-value database.

type Writer

type Writer interface {
	Put(key, value []byte) error
	Delete(key []byte) error
}

Writer defines write-only operations for a key-value database.

Directories

Path Synopsis
provider

Jump to

Keyboard shortcuts

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