kvdriver

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorParamEmpty liberr.CodeError = iota + liberr.MinPkgDatabaseKVDrv
	ErrorBadInstance
	ErrorGetFunction
	ErrorSetFunction
	ErrorListFunction
	ErrorFunctionParams
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver[K comparable, M any] struct {
	KVDriver[K, M]

	FctGet  FuncGet[K, M]
	FctSet  FuncSet[K, M]
	FctList FuncList[K, M]
	FctWalk FuncWalk[K, M] // optional
}

func (*Driver[K, M]) Get

func (o *Driver[K, M]) Get(key K, model *M) error

func (*Driver[K, M]) List

func (o *Driver[K, M]) List() ([]K, error)

func (*Driver[K, M]) Set

func (o *Driver[K, M]) Set(key K, model M) error

func (*Driver[K, M]) Walk

func (o *Driver[K, M]) Walk(fct FctWalk[K, M]) error

type FctWalk

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

type FuncGet

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

type FuncList

type FuncList[K comparable, M any] func() ([]K, error)

type FuncSet

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

type FuncWalk

type FuncWalk[K comparable, M any] func(fct FctWalk[K, M]) error

type KVDriver

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

Jump to

Keyboard shortcuts

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