db

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch interface {
	SetColumnFamily(cf *gorocksdb.ColumnFamilyHandle, key, value []byte)
	Write() (int, error)
}

type CRocksDB

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

func NewCRocksDB

func NewCRocksDB(name, dir string) (*CRocksDB, error)

func (*CRocksDB) Close

func (db *CRocksDB) Close()

Implements DB.

func (CRocksDB) ColumnFamilyHandles

func (db CRocksDB) ColumnFamilyHandles() gorocksdb.ColumnFamilyHandles

Implements DB.

func (CRocksDB) GetDataFromColumnFamily

func (db CRocksDB) GetDataFromColumnFamily(index int, key []byte) (*gorocksdb.Slice, error)

Implements DB.

func (CRocksDB) Iterator

func (db CRocksDB) Iterator(start, end []byte) Iterator

Implements DB.

func (CRocksDB) IteratorColumnFamily

func (db CRocksDB) IteratorColumnFamily(start, end []byte, cf *gorocksdb.ColumnFamilyHandle) Iterator

Implements DB.

func (CRocksDB) NewBatch

func (db CRocksDB) NewBatch() Batch

Implements DB.

func (*CRocksDB) SetDataInColumnFamily

func (db *CRocksDB) SetDataInColumnFamily(index int, key, value []byte) error

Implements DB.

type DB

type DB interface {
	// Get value from specific ColumnFamily
	GetDataFromColumnFamily(index int, key []byte) (*gorocksdb.Slice, error)

	// Set value In specific ColumnFamily
	SetDataInColumnFamily(index int, key, value []byte) error

	// Specific Column Family Iterator
	IteratorColumnFamily(start, end []byte, cf *gorocksdb.ColumnFamilyHandle) Iterator

	// Creates a batch for atomic updates.
	NewBatch() Batch

	// Get all ColumnFamily handles which return slice of *columnFamilyHandle
	ColumnFamilyHandles() gorocksdb.ColumnFamilyHandles

	// Iterate over a domain of keys in ascending order. End is exclusive.
	// Start must be less than end, or the Iterator is invalid.
	// A nil start is interpreted as an empty byteslice.
	// If end is nil, iterates up to the last item (inclusive).
	// CONTRACT: No writes may happen within a domain while an iterator exists over it.
	// CONTRACT: start, end readonly []byte
	Iterator(start, end []byte) Iterator

	// Closes the connection.
	Close()
}

DBs are goroutine safe.

type Iterator

type Iterator interface {
	Valid() bool

	Next()

	Key() (key []byte)

	Value() (value []byte)

	Close()

	Seek(key []byte)
	// contains filtered or unexported methods
}

---------------------------------------- Iterator

Jump to

Keyboard shortcuts

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