ldb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Del

func Del(key []byte)

func ForEach

func ForEach(prefix []byte, RemovePrefix bool, fn FOR_EACH_FUNC)

func ForEachKey

func ForEachKey(prefix []byte, limit int, offset int, RemovePrefix bool, fn FOR_EACH_KEY_FUNC)

func Get

func Get(key []byte) []byte

func Has

func Has(key []byte) bool

func Init

func Init(cfg *Config)

func InitProxy

func InitProxy(cfg *Config)

func List

func List(prefix []byte, limit int, offset int, RemovePrefix bool) [][]byte

func Set

func Set(key []byte, value []byte)

func TestInit

func TestInit()

func Total

func Total(prefix []byte) int64

func Use

func Use(base string)

Types

type Config

type Config struct {
	Path        string `json:"path"`
	Compression bool   `json:"compression"`
	FileSize    int    `json:"filesize"`
	ReadOnly    bool   `json:"readonly"`
}

func (*Config) Clone

func (c *Config) Clone() *Config

type DB

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

func New

func New(cfg *Config, def bool) (*DB, error)

func (*DB) Close

func (db *DB) Close()

func (*DB) Del

func (db *DB) Del(key []byte)

func (*DB) ForEach

func (db *DB) ForEach(prefix []byte, RemovePrefix bool, fn FOR_EACH_FUNC)

func (*DB) ForEachKey

func (db *DB) ForEachKey(prefix []byte, limit int, offset int, RemovePrefix bool, fn FOR_EACH_KEY_FUNC)

func (*DB) Get

func (db *DB) Get(key []byte) []byte

func (*DB) Has

func (db *DB) Has(key []byte) bool

func (*DB) List

func (db *DB) List(prefix []byte, limit int, offset int, RemovePrefix bool) [][]byte

func (*DB) Set

func (db *DB) Set(key []byte, value []byte)

func (*DB) Total

func (db *DB) Total(prefix []byte) int64

type FOR_EACH_FUNC

type FOR_EACH_FUNC func([]byte, []byte) bool

type FOR_EACH_KEY_FUNC

type FOR_EACH_KEY_FUNC func([]byte) bool

type FakeDB

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

func NewFakeDB

func NewFakeDB() *FakeDB

func (*FakeDB) Close

func (db *FakeDB) Close()

func (*FakeDB) Del

func (db *FakeDB) Del(key []byte)

func (*FakeDB) ForEach

func (db *FakeDB) ForEach(prefix []byte, RemovePrefix bool, fn FOR_EACH_FUNC)

func (*FakeDB) ForEachKey

func (db *FakeDB) ForEachKey(prefix []byte, limit int, offset int, RemovePrefix bool, fn FOR_EACH_KEY_FUNC)

func (*FakeDB) Get

func (db *FakeDB) Get(key []byte) []byte

func (*FakeDB) Has

func (db *FakeDB) Has(key []byte) bool

func (*FakeDB) List

func (db *FakeDB) List(prefix []byte, limit int, offset int, RemovePrefix bool) [][]byte

func (*FakeDB) Set

func (db *FakeDB) Set(key []byte, value []byte)

func (*FakeDB) Total

func (db *FakeDB) Total(prefix []byte) int64

type Storage

type Storage interface {
	Close()
	Set([]byte, []byte)
	Get([]byte) []byte
	Has([]byte) bool
	Del([]byte)
	Total(prefix []byte) int64
	List(prefix []byte, limit int, offset int, RemovePrefix bool) [][]byte
	ForEach(prefix []byte, RemovePrefix bool, fn FOR_EACH_FUNC)
	ForEachKey(prefix []byte, limit int, offset int, RemovePrefix bool, fn FOR_EACH_KEY_FUNC)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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