dbstore

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBatchSize = 100 * 1024

the max size of the batch

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch interface {
	DBPutter
	DBDeleter
	ValueSize() int // amount of data in the batch
	Write() error
	// Reset resets the batch for reuse
	Reset()
}

Batch is a write-only database that commits changes to its host database when Write is called. Batch cannot be used concurrently.

type DBDeleter

type DBDeleter interface {
	Delete(key []byte) error
}

Deleter wraps the database delete operation supported by both batches and regular databases.

type DBPutter

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

Putter wraps the database write operation supported by both batches and regular databases.

type DBStore

type DBStore interface {
	DBPutter
	DBDeleter
	// Get get from db
	Get(key []byte) ([]byte, error)
	// NewBatch create db batch
	NewBatch() Batch
}

DBStore represent the low level database to store block

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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