donkeydb

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

README

DonkeyDB

DonkeyDB is an impractical disk-backed database intented to study key-value databases.

Roadmap

  • Disk-backed storage (small memory footprint)
  • Support basic GET and SET commands for string values
  • Can be used both as a server and embedded
  • Support for DEL command
  • Reuse empty pages
  • Support for integer values
  • Page caching (LRU)
  • Benchmark (correctness, memory, performance)
  • Compress pages

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNothing reports a non-existing key.
	ErrNothing = errors.New("donkey: key not found")
	// ErrKeyTooShort reports an empty key.
	ErrKeyTooShort = errors.New("donkey: key is too short")
	// ErrKeyTooLong reports a too long key.
	ErrKeyTooLong = errors.New("donkey: key is too long")
	// ErrUnsuppValue reports an unsupported value type.
	ErrUnsuppValue = errors.New("donkey: unsupported value")
	// ErrValueTooLong reports a too long value.
	ErrValueTooLong = errors.New("donkey: value is too long")
)

Functions

This section is empty.

Types

type Database

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

Database is a disk-backed key-value database.

func Create

func Create(s io.ReadWriteSeeker) (*Database, error)

Create creates a new key-value database.

func Open

func Open(s io.ReadWriteSeeker) (*Database, error)

Open opens an existing key-value database.

func (*Database) Del added in v0.2.0

func (d *Database) Del(key string) error

Del removes a value for a given key.

func (*Database) Get

func (d *Database) Get(key string) (interface{}, error)

Get retrieves a value for a given key.

func (*Database) Set

func (d *Database) Set(key string, value interface{}) error

Set stores a value for a given key.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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