memorydb

package
v0.0.0-...-e1aa8c7 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(options map[string]interface{}) (kvdb.Database, error)

Open returns target db instance

Types

type Database

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

Database is an ephemeral key-value store. Apart from basic data storage functionality it also supports batch writes and iterating over the keyspace in binary-alphabetical order.

func (*Database) Close

func (db *Database) Close() error

Close close the target db

func (*Database) Delete

func (db *Database) Delete(key []byte) error

Delete removes the key from the key-value data store.

func (*Database) Get

func (db *Database) Get(key []byte) ([]byte, error)

Get retrieves the given key if it's present in the key-value data store.

func (*Database) Has

func (db *Database) Has(key []byte) (bool, error)

Has retrieves if a key is present in the key-value data store.

func (*Database) NewBatch

func (db *Database) NewBatch() kvdb.Batch

func (*Database) NewIterator

func (db *Database) NewIterator(prefix []byte, start []byte) kvdb.Iterator

func (*Database) Put

func (db *Database) Put(key []byte, value []byte) error

Put inserts the given value into the key-value data store.

func (*Database) Stat

func (db *Database) Stat(property string) (string, error)

Jump to

Keyboard shortcuts

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