database

package
v0.0.0-...-c7fb743 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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