driver

package
v0.0.0-...-8bd0779 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 1 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListStores

func ListStores() []string

func Register

func Register(s IStore) error

Types

type GoSlice

type GoSlice []byte

func (GoSlice) Data

func (s GoSlice) Data() []byte

func (GoSlice) Free

func (s GoSlice) Free()

func (GoSlice) Size

func (s GoSlice) Size() int

type IDB

type IDB interface {
	Close() error

	Get(key []byte) ([]byte, error)

	Put(key []byte, value []byte) error
	Delete(key []byte) error

	SyncPut(key []byte, value []byte) error
	SyncDelete(key []byte) error

	NewIterator() IIterator

	NewWriteBatch() IWriteBatch

	NewSnapshot() (ISnapshot, error)

	Compact() error
}

type IIterator

type IIterator interface {
	Close() error

	First()
	Last()
	Seek(key []byte)

	Next()
	Prev()

	Valid() bool

	Key() []byte
	Value() []byte

	Error() error
}

type ISlice

type ISlice interface {
	Data() []byte
	Size() int
	Free()
}

ISlice interface for use go/cgo leveldb/rocksdb lib slice op

type ISliceGeter

type ISliceGeter interface {
	GetSlice(key []byte) (ISlice, error)
}

ISliceGetrer interface for use cgo leveldb/rocksdb lib slice get op

type ISnapshot

type ISnapshot interface {
	Get(key []byte) ([]byte, error)
	NewIterator() IIterator
	Close()
}

type IStore

type IStore interface {
	Name() string
	Open(path string) (IDB, error)
	Repair(path string) error
}

func GetStore

func GetStore(kvStoreName string) (IStore, error)

type IWriteBatch

type IWriteBatch interface {
	Put(key []byte, value []byte)
	Delete(key []byte)
	// write to os buffer
	Commit() error
	// sync to stable disk
	SyncCommit() error
	// resets the batch
	Rollback() error
	// batch data
	Data() []byte
	// close WriteBatch
	Close()
}

Jump to

Keyboard shortcuts

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