db

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValueReader

type KeyValueReader interface {
	GetByKey(key []byte) ([]byte, error)
}

type KeyValueReaderWriter

type KeyValueReaderWriter interface {
	KeyValueReader
	KeyValueWriter
}

type KeyValueWriter

type KeyValueWriter interface {
	SetByKey(key []byte, value []byte) error
}

type LevelDB

type LevelDB struct {
	*leveldb.DB
}

func NewLvlDB

func NewLvlDB(path string) (*LevelDB, error)

NewLvlDB returns a new LevelDB instance.

func (*LevelDB) Close

func (db *LevelDB) Close() error

func (*LevelDB) GetByKey

func (db *LevelDB) GetByKey(key []byte) ([]byte, error)

func (*LevelDB) SetByKey

func (db *LevelDB) SetByKey(key []byte, value []byte) error

type LevelDBConfig

type LevelDBConfig struct {
	Path string `json:"Path"`
}

func DefaultLevelDBConfig

func DefaultLevelDBConfig() LevelDBConfig

func (LevelDBConfig) IsValid

func (cfg LevelDBConfig) IsValid() (bool, error)

Jump to

Keyboard shortcuts

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