kvstorage

package
v0.0.0-...-1fc08d0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryDB

type MemoryDB map[string]any

MemoryDB is a type alias for in memory-db type.

type StorageOption

type StorageOption func(*memoryStorage)

StorageOption represents storage option type.

func WithMemoryDB

func WithMemoryDB(db MemoryDB) StorageOption

WithMemoryDB sets db option.

type Storer

type Storer interface {
	Set(key string, value any) (any, error)
	Get(key string) (any, error)
	Update(key string, value any) (any, error)
	Delete(key string) error
	List() MemoryDB
}

Storer defines storage behaviours.

func New

func New(options ...StorageOption) Storer

New instantiates new storage instance.

Jump to

Keyboard shortcuts

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