leveldbstorage

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchRemove

func BatchRemove(st *Storage, r *leveldbutil.Range, limit int) (int, error)

func HashPrefix

func HashPrefix(b []byte) []byte

func RemoveByPrefix

func RemoveByPrefix(st *Storage, prefix []byte) error

Types

type PrefixStorage

type PrefixStorage struct {
	sync.RWMutex
	*Storage
	// contains filtered or unexported fields
}

func NewPrefixStorage

func NewPrefixStorage(st *Storage, prefix []byte) *PrefixStorage

func (*PrefixStorage) Batch

func (*PrefixStorage) Close

func (st *PrefixStorage) Close() error

func (*PrefixStorage) Delete

func (st *PrefixStorage) Delete(key []byte, opt *leveldbOpt.WriteOptions) error

func (*PrefixStorage) Exists

func (st *PrefixStorage) Exists(key []byte) (bool, error)

func (*PrefixStorage) Get

func (st *PrefixStorage) Get(key []byte) ([]byte, bool, error)

func (*PrefixStorage) Iter

func (st *PrefixStorage) Iter(
	r *leveldbutil.Range,
	callback func([]byte, []byte) (bool, error),
	sort bool,
) error

func (*PrefixStorage) NewBatch

func (st *PrefixStorage) NewBatch() *PrefixStorageBatch

func (*PrefixStorage) Prefix

func (st *PrefixStorage) Prefix() []byte

func (*PrefixStorage) Put

func (st *PrefixStorage) Put(key, b []byte, opt *leveldbOpt.WriteOptions) error

func (*PrefixStorage) RawStorage

func (st *PrefixStorage) RawStorage() *Storage

func (*PrefixStorage) Remove

func (st *PrefixStorage) Remove() error

type PrefixStorageBatch

type PrefixStorageBatch struct {
	*leveldb.Batch
	// contains filtered or unexported fields
}

func (*PrefixStorageBatch) Delete

func (b *PrefixStorageBatch) Delete(key []byte)

func (*PrefixStorageBatch) Put

func (b *PrefixStorageBatch) Put(key, i []byte)

type Storage

type Storage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(str leveldbStorage.Storage, opt *leveldbOpt.Options) (*Storage, error)

func (*Storage) Batch

func (st *Storage) Batch(batch *leveldb.Batch, wo *leveldbOpt.WriteOptions) error

func (*Storage) Clean

func (st *Storage) Clean() error

func (*Storage) Close

func (st *Storage) Close() error

func (*Storage) DB

func (st *Storage) DB() *leveldb.DB

func (*Storage) Delete

func (st *Storage) Delete(k []byte, opt *leveldbOpt.WriteOptions) error

func (*Storage) Exists

func (st *Storage) Exists(key []byte) (bool, error)

func (*Storage) Get

func (st *Storage) Get(key []byte) ([]byte, bool, error)

func (*Storage) Iter

func (st *Storage) Iter(
	r *leveldbutil.Range,
	callback func(key []byte, raw []byte) (bool, error),
	sort bool,
) error

func (*Storage) Put

func (st *Storage) Put(k, b []byte, opt *leveldbOpt.WriteOptions) error

Jump to

Keyboard shortcuts

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