database

package
v0.3.35 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound - not found
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Batch

type Batch interface {
	// Put - put key / value
	Put(key, value []byte) error
	// Delete - delete key
	Delete(key []byte) error
	// Write - start batch
	Write() error
	// ValueSize - return contorl nums
	ValueSize() int
	// Reset - reset batch
	Reset()
}

Batch - batch control

type Database

type Database interface {
	// GetPath - returns the path to the database directory
	GetPath() string
	// Put - put the key / value
	Put(key []byte, value []byte) error
	// Has - is exist key
	Has(key []byte) (bool, error)
	// Get - returns the given key if it's present
	Get(key []byte) ([]byte, error)
	// Delete - deletes the key from the queue and database
	Delete(key []byte) error
	// NewIterator - new iterator
	NewIterator() iterator.Iterator
	// NewIteratorWithPrefix - new iterator with prefix
	NewIteratorWithPrefix(prefix []byte) iterator.Iterator
	// Close - close database
	Close()
	// NewBatch - new batch
	NewBatch() Batch
}

Database - key / value database

func NewAnkaLDB

func NewAnkaLDB(dbpath string, cache int, handles int) (Database, error)

NewAnkaLDB - returns a ankaDB wrapped object.

Jump to

Keyboard shortcuts

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