storage

package
v0.0.0-...-ec04e22 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-3.0 Imports: 5 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 {
	Set(key Key, value Value) error
	ValueSize() int
	SyncWrite() error
}

type Database

type Database interface {
	Set(key Key, value Value) error
	Get(key Key) (Value, error)
	Has(key Key) (bool, error)
	Delete(key Key) error
	NewBatch() Batch
	Close() error
}

func NewDatabase

func NewDatabase(config config.DBConfig) (Database, error)

func NewLevelDatabase

func NewLevelDatabase(config config.DBConfig) (Database, error)

type Key

type Key []byte

type LevelBatch

type LevelBatch struct {
	// contains filtered or unexported fields
}

func (*LevelBatch) Set

func (lb *LevelBatch) Set(key Key, value Value) error

func (*LevelBatch) SyncWrite

func (lb *LevelBatch) SyncWrite() error

func (*LevelBatch) ValueSize

func (lb *LevelBatch) ValueSize() int

type LevelDatabase

type LevelDatabase struct {
	// contains filtered or unexported fields
}

func (*LevelDatabase) Close

func (db *LevelDatabase) Close() error

func (*LevelDatabase) Delete

func (db *LevelDatabase) Delete(key Key) error

func (*LevelDatabase) Get

func (db *LevelDatabase) Get(key Key) (Value, error)

func (*LevelDatabase) Has

func (db *LevelDatabase) Has(key Key) (bool, error)

func (*LevelDatabase) NewBatch

func (db *LevelDatabase) NewBatch() Batch

func (*LevelDatabase) Set

func (db *LevelDatabase) Set(key Key, value Value) error

type Value

type Value []byte

Jump to

Keyboard shortcuts

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