strdy

package
v0.0.0-...-af49336 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

strdy (pronounced "sturdy") is a database for holding a string-to-string map. Keys and Values should not contain ASCII control characters, and particularly not tabs nor newlines.

It is not designed for large amounts of data that would not fit nicely in memory.

The in-memory data structure is a skiplist in lexical order of the keys.

The database is backed by a flat textfile, which is appended as records are inserted or updated.

Index

Constants

View Source
const TimeFormat = "2006-0102-150405"

Variables

This section is empty.

Functions

func Timestamp

func Timestamp() string

Types

type DB

type DB struct {
	List     *skiplist.SkipList
	Filename string
	W        io.Writer
}

func Load

func Load(filename string) *DB

func (*DB) Get

func (db *DB) Get(key string) string

Get returns "" if key not found.

func (*DB) Set

func (db *DB) Set(key, value, comment string)

type Record

type Record struct {
	Key       string
	Timestamp string
	Value     string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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