kvs

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Type Type        `yaml:"type" json:"type"`
	Cfg  interface{} `yaml:"cfg"  json:"cfg"`
}

type InMemKVS

type InMemKVS struct {
	*InMemKVSCfg
	// contains filtered or unexported fields
}

func NewInMemKVS

func NewInMemKVS() *InMemKVS

func (*InMemKVS) Collect

func (b *InMemKVS) Collect() map[string]any

func (*InMemKVS) CollectAsString

func (b *InMemKVS) CollectAsString() map[string]string

func (*InMemKVS) Del

func (b *InMemKVS) Del(k string)

func (*InMemKVS) Load

func (b *InMemKVS) Load(k string) (any, bool)

func (*InMemKVS) LoadAndDelete

func (b *InMemKVS) LoadAndDelete(k string) (any, bool)

func (*InMemKVS) LoadAsBool

func (b *InMemKVS) LoadAsBool(k string) bool

func (*InMemKVS) LoadAsFloat

func (b *InMemKVS) LoadAsFloat(k string) float64

func (*InMemKVS) LoadAsFloatOr

func (b *InMemKVS) LoadAsFloatOr(k string, d float64) float64

func (*InMemKVS) LoadAsInt

func (b *InMemKVS) LoadAsInt(k string) int

func (*InMemKVS) LoadAsIntOr

func (b *InMemKVS) LoadAsIntOr(k string, d int) int

func (*InMemKVS) LoadAsString

func (b *InMemKVS) LoadAsString(k string) string

func (*InMemKVS) LoadAsStringOr

func (b *InMemKVS) LoadAsStringOr(k string, d string) string

func (*InMemKVS) LoadAsUint

func (b *InMemKVS) LoadAsUint(k string) uint

func (*InMemKVS) LoadAsUintOr

func (b *InMemKVS) LoadAsUintOr(k string, d uint) uint

func (*InMemKVS) LoadOrStore

func (b *InMemKVS) LoadOrStore(k string, v any) (any, bool)

func (*InMemKVS) LoadTo

func (b *InMemKVS) LoadTo(k string, to any) error

func (*InMemKVS) Range

func (b *InMemKVS) Range(f func(k string, v any) bool)

func (*InMemKVS) Store

func (b *InMemKVS) Store(k string, v any)

func (*InMemKVS) StoreAsString

func (b *InMemKVS) StoreAsString(k string, v any)

func (*InMemKVS) Stores

func (b *InMemKVS) Stores(m map[string]any)

type InMemKVSCfg

type InMemKVSCfg struct{}

func NewInMemKVSCfg

func NewInMemKVSCfg() *InMemKVSCfg

type KVS

type KVS interface {
	Store(k string, v any)
	StoreAsString(k string, v any)
	Stores(map[string]any)
	Load(k string) (any, bool)
	LoadOrStore(k string, v any) (any, bool)
	LoadAndDelete(k string) (any, bool)
	Del(k string)
	LoadAsBool(k string) bool
	LoadAsString(k string) string
	LoadAsStringOr(k string, d string) string
	LoadAsInt(k string) int
	LoadAsIntOr(k string, d int) int
	LoadAsUint(k string) uint
	LoadAsUintOr(k string, d uint) uint
	LoadAsFloat(k string) float64
	LoadAsFloatOr(k string, d float64) float64
	LoadTo(k string, to any) error
	Collect() map[string]any
	CollectAsString() map[string]string
	Range(func(k string, v any) bool)
}

type Type

type Type string
const TypeInMem Type = "inmem"

Jump to

Keyboard shortcuts

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