kvtypes

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FctWalk

type FctWalk[K comparable, M any] func(key K, model M) bool

type FuncWalk

type FuncWalk[K comparable, M any] func(kv KVItem[K, M]) bool

type KVDriver

type KVDriver[K comparable, M any] interface {
	New() KVDriver[K, M]
	Get(key K, model *M) error
	Set(key K, model M) error
	Del(key K) error
	List() ([]K, error)
	Walk(fct FctWalk[K, M]) error
}

type KVItem

type KVItem[K comparable, M any] interface {
	Set(model M)
	Get() M
	Key() K

	Load() error
	Store(force bool) error
	Remove() error
	Clean()

	HasChange() bool
}

type KVTable

type KVTable[K comparable, M any] interface {
	Get(key K) (KVItem[K, M], error)
	Del(key K) error
	List() ([]KVItem[K, M], error)
	Walk(fct FuncWalk[K, M]) error
}

Jump to

Keyboard shortcuts

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