kvstore

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound = errors.New("key not found")
	ErrKeyExpired  = errors.New("key expired")
)

Functions

func WithExpiry

func WithExpiry(expiresIn time.Duration) func(*setOpts)

Types

type KVStore

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

func New

func New(db *sql.DB, purgeFreq time.Duration) (*KVStore, error)

[db] must be an sqlite3 database

func (*KVStore) Close

func (kv *KVStore) Close() error

func (*KVStore) Delete

func (kv *KVStore) Delete(key string) error

func (*KVStore) Get

func (kv *KVStore) Get(key string) (string, error)

func (*KVStore) Set

func (kv *KVStore) Set(key string, value string, optFuncs ...func(*setOpts)) error

Jump to

Keyboard shortcuts

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