memorydb

package
v0.0.0-...-e884aa9 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package memorydb implements the key-value database layer based on memory maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProducer

func NewProducer(namespace string, mods ...Mod) kvdb.IterableDBProducer

NewProducer of memory db.

Types

type Database

type Database struct {
	kvdb.DropableStore
}

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 New

func New() *Database

New returns a wrapped map with all the required database interface methods implemented.

func NewWithDrop

func NewWithDrop(drop func()) *Database

NewWithDrop is the same as New, but defines onDrop callback.

type Mod

type Producer

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

func (*Producer) Names

func (p *Producer) Names() []string

Names of existing databases.

func (*Producer) OpenDB

func (p *Producer) OpenDB(name string) (kvdb.DropableStore, error)

OpenDB or create db with name.

Jump to

Keyboard shortcuts

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