kevlar

package module
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 14 Imported by: 31

README

kevlar

kevlar is a minimal overhead key value store backed by the filesystem.

Documentation

Index

Constants

View Source
const (
	JsonExt = ".json"
	GobExt  = ".gob"
	HtmlExt = ".html"
	XmlExt  = ".xml"
)
View Source
const UnknownModTime = -1

Variables

This section is empty.

Functions

func Migrate added in v0.5.4

func Migrate(dir string) error

Types

type KeyValues

type KeyValues interface {
	Len() int
	Keys() iter.Seq[string]
	Has(key string) bool

	Get(key string) (io.ReadCloser, error)
	Set(key string, data io.Reader) error
	Cut(key string) error

	Since(ts int64, mts ...MutationType) iter.Seq2[string, MutationType]

	LogModTime(key string) int64
	FileModTime(key string) (int64, error)
}

func New added in v0.6.5

func New(dir, ext string) (KeyValues, error)

New connects a new local key value storage at the specified directory and will use specified extension for the value files

type MutationType added in v0.6.5

type MutationType int
const (
	Create MutationType = iota
	Update
	Cut
)

func (MutationType) String added in v0.6.5

func (mt MutationType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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