linkdb

package module
v0.0.0-...-57bb98e Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 9 Imported by: 0

README

linkdb GoDoc Actions Status Actions Status Actions Status Actions Status

A persistent key-value store built using linked list datastructure

Documentation

Overview

linkdb is a key-value store for persistent storage. It aims to store both small and large values efficiently with minimal disk IOPS per operation. Since it keeps all the keys in memory, it is not suitable for storing large number of keys.

Index

Constants

View Source
const (
	MinBlockSize = 4 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database[T proto.Message] interface {
	Metadata() T
	Get(key string) (T, []byte, error)
	GetRange(key string, off int64, len int64) (T, []byte, error)
	Put(key string, t T, value []byte) error
	List() map[string]T
}

func Format

func Format[T proto.Message](disk Disk, metadata T, initValues ...T) (Database[T], error)

func Open

func Open[T proto.Message](disk Disk) (Database[T], error)

type Disk

type Disk interface {
	io.WriterAt
	io.ReaderAt

	BlockSize() int64
	Capacity() int64
}

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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