storage

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package storage is a flat file key/value store with optional value expirations.

Index

Constants

This section is empty.

Variables

View Source
var LogOnCloseErrorFunc = bits.LogOnCloseError

LogOnCloseErrorFunc is the function called when a deferred Close returns an error.

Functions

func Get

func Get[T any](name string) (T, error)

Get retrieves and deserialises the value stored under name as type T.

func Has

func Has(name string) bool

Has reports whether name exists and has not expired.

func Remove

func Remove(name string) error

Remove deletes the value and expiration date stored under name.

func Set

func Set[T any](name string, value T) error

Set persists value under name, clearing any prior expiration date.

func SetWithExpiration

func SetWithExpiration[T any](name string, value T, duration time.Duration) error

SetWithExpiration persists value under name and expires it after duration.

func Setup

func Setup(path string) error

Setup initialises the storage package to use the given directory path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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