kvitem

package
v1.12.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrorParamEmpty liberr.CodeError = iota + liberr.MinPkgDatabaseKVItm
	ErrorLoadFunction
	ErrorStoreFunction
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FuncLoad

type FuncLoad[K comparable, M any] func(key K, model *M) error

type FuncStore

type FuncStore[K comparable, M any] func(key K, model M) error

type KVItem

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

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

	HasChange() bool

	RegisterFctLoad(fct FuncLoad[K, M])
	RegisterFctStore(fct FuncStore[K, M])
}

func New

func New[K comparable, M any](key K) KVItem[K, M]

Jump to

Keyboard shortcuts

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