kvdb

package
v3.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

* file description: database for key-value * @Author: May Luo * @Date: 2017-12-04 * @Last Modified by: * @Last Modified time:

Index

Constants

This section is empty.

Variables

View Source
var OpenFileLimit = 64

OpenFileLimit is to limiting the size of open leveldb

Functions

This section is empty.

Types

type KVDatabase

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

KVDatabase struct

func NewKVDatabase

func NewKVDatabase(file string) (*KVDatabase, error)

NewKVDatabase is to create a new kv database

func (*KVDatabase) CallClose

func (k *KVDatabase) CallClose()

CallClose is to close object

func (*KVDatabase) CallDelete

func (k *KVDatabase) CallDelete(key []byte) error

CallDelete is to delete object by key

func (*KVDatabase) CallFlush

func (k *KVDatabase) CallFlush() error

CallFlush is to flush object

func (*KVDatabase) CallGet

func (k *KVDatabase) CallGet(key []byte) ([]byte, error)

CallGet is to get object by key and return value

func (*KVDatabase) CallNewIterator

func (k *KVDatabase) CallNewIterator() iterator.Iterator

CallNewIterator is to interate object

func (*KVDatabase) CallNewIteratorPrefix

func (k *KVDatabase) CallNewIteratorPrefix() iterator.Iterator

CallNewIteratorPrefix is to iterate prefix

func (*KVDatabase) CallPut

func (k *KVDatabase) CallPut(key []byte, value []byte) error

CallPut is to put object by key and value

func (*KVDatabase) CallSeek

func (k *KVDatabase) CallSeek(prefixKey []byte) ([]string, error)

CallSeek is to seek object

type KvDBRepo

type KvDBRepo interface {
	CallPut(key []byte, value []byte) error
	CallGet(key []byte) ([]byte, error)
	CallDelete(key []byte) error
	CallClose()
	CallFlush() error
	CallSeek(prefixKey []byte) ([]string, error)

	CallNewIterator() iterator.Iterator
}

KvDBRepo is interface for leveldb

Jump to

Keyboard shortcuts

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