Documentation
¶
Index ¶
- func LoadAsBool(kvs KVS, k string) (bool, error)
- func LoadAsFloat(kvs KVS, k string) (float64, error)
- func LoadAsFloatOr(kvs KVS, k string, d float64) (float64, error)
- func LoadAsInt(kvs KVS, k string) (int, error)
- func LoadAsIntOr(kvs KVS, k string, d int) (int, error)
- func LoadAsString(kvs KVS, k string) (string, error)
- func LoadAsStringOr(kvs KVS, k string, d string) (string, error)
- func LoadAsUint(kvs KVS, k string) (uint, error)
- func LoadAsUintOr(kvs KVS, k string, d uint) (uint, error)
- func LoadTo(kvs KVS, k string, to any) error
- type Cfg
- type DBModel
- type InMemKVS
- func (i *InMemKVS) Close() error
- func (i *InMemKVS) Collect() (map[string]any, error)
- func (i *InMemKVS) CollectAsString() (map[string]string, error)
- func (i *InMemKVS) Del(k string) error
- func (i *InMemKVS) GetCfg() interface{}
- func (i *InMemKVS) Load(k string) (any, bool, error)
- func (i *InMemKVS) LoadAndDelete(k string) (any, bool, error)
- func (i *InMemKVS) LoadAsBool(k string) (bool, error)
- func (i *InMemKVS) LoadAsFloat(k string) (float64, error)
- func (i *InMemKVS) LoadAsFloatOr(k string, d float64) (float64, error)
- func (i *InMemKVS) LoadAsInt(k string) (int, error)
- func (i *InMemKVS) LoadAsIntOr(k string, d int) (int, error)
- func (i *InMemKVS) LoadAsString(k string) (string, error)
- func (i *InMemKVS) LoadAsStringOr(k string, d string) (string, error)
- func (i *InMemKVS) LoadAsUint(k string) (uint, error)
- func (i *InMemKVS) LoadAsUintOr(k string, d uint) (uint, error)
- func (i *InMemKVS) LoadOrStore(k string, v any) (any, bool, error)
- func (i *InMemKVS) LoadTo(k string, to any) error
- func (i *InMemKVS) Open() error
- func (i *InMemKVS) Range(f func(k string, v any) bool) error
- func (i *InMemKVS) Store(k string, v any) error
- func (i *InMemKVS) StoreAsString(k string, v any) error
- func (i *InMemKVS) Type() interface{}
- type InMemKVSCfg
- type KVS
- type SQLiteKVS
- func (s *SQLiteKVS) Close() error
- func (s *SQLiteKVS) Collect() (map[string]any, error)
- func (s *SQLiteKVS) CollectAsString() (map[string]string, error)
- func (s *SQLiteKVS) Del(k string) error
- func (s *SQLiteKVS) GetCfg() interface{}
- func (s *SQLiteKVS) Load(k string) (any, bool, error)
- func (s *SQLiteKVS) LoadAndDelete(k string) (any, bool, error)
- func (s *SQLiteKVS) LoadAsBool(k string) (bool, error)
- func (s *SQLiteKVS) LoadAsFloat(k string) (float64, error)
- func (s *SQLiteKVS) LoadAsFloatOr(k string, d float64) (float64, error)
- func (s *SQLiteKVS) LoadAsInt(k string) (int, error)
- func (s *SQLiteKVS) LoadAsIntOr(k string, d int) (int, error)
- func (s *SQLiteKVS) LoadAsString(k string) (string, error)
- func (s *SQLiteKVS) LoadAsStringOr(k string, d string) (string, error)
- func (s *SQLiteKVS) LoadAsUint(k string) (uint, error)
- func (s *SQLiteKVS) LoadAsUintOr(k string, d uint) (uint, error)
- func (s *SQLiteKVS) LoadOrStore(k string, v any) (any, bool, error)
- func (s *SQLiteKVS) LoadTo(k string, to any) error
- func (s *SQLiteKVS) Open() error
- func (s *SQLiteKVS) Range(f func(k string, v any) bool) error
- func (s *SQLiteKVS) Store(k string, v any) error
- func (s *SQLiteKVS) StoreAsString(k string, v any) error
- func (s *SQLiteKVS) Type() interface{}
- type SQLiteKVSCfg
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadAsFloatOr ¶ added in v0.7.5
func LoadAsStringOr ¶ added in v0.7.5
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) LoadAsFloatOr ¶
func (*InMemKVS) LoadAsStringOr ¶
type InMemKVSCfg ¶
type InMemKVSCfg struct{}
func NewInMemKVSCfg ¶
func NewInMemKVSCfg() *InMemKVSCfg
type KVS ¶
type KVS interface {
plugin.Plugin
Open() error
Close() error
Store(k string, v any) error
StoreAsString(k string, v any) error
Load(k string) (any, bool, error)
LoadOrStore(k string, v any) (any, bool, error)
LoadAndDelete(k string) (any, bool, error)
Del(k string) error
LoadAsBool(k string) (bool, error)
LoadAsString(k string) (string, error)
LoadAsStringOr(k string, d string) (string, error)
LoadAsInt(k string) (int, error)
LoadAsIntOr(k string, d int) (int, error)
LoadAsUint(k string) (uint, error)
LoadAsUintOr(k string, d uint) (uint, error)
LoadAsFloat(k string) (float64, error)
LoadAsFloatOr(k string, d float64) (float64, error)
LoadTo(k string, to any) error
Collect() (map[string]any, error)
CollectAsString() (map[string]string, error)
Range(func(k string, v any) bool) error
}
type SQLiteKVS ¶ added in v0.7.6
type SQLiteKVS struct {
*SQLiteKVSCfg
// contains filtered or unexported fields
}
func NewSQLiteKVS ¶ added in v0.7.6
func NewSQLiteKVS() *SQLiteKVS
func (*SQLiteKVS) CollectAsString ¶ added in v0.7.6
func (*SQLiteKVS) LoadAndDelete ¶ added in v0.7.6
func (*SQLiteKVS) LoadAsBool ¶ added in v0.7.6
func (*SQLiteKVS) LoadAsFloat ¶ added in v0.7.6
func (*SQLiteKVS) LoadAsFloatOr ¶ added in v0.7.6
func (*SQLiteKVS) LoadAsIntOr ¶ added in v0.7.6
func (*SQLiteKVS) LoadAsString ¶ added in v0.7.6
func (*SQLiteKVS) LoadAsStringOr ¶ added in v0.7.6
func (*SQLiteKVS) LoadAsUint ¶ added in v0.7.6
func (*SQLiteKVS) LoadAsUintOr ¶ added in v0.7.6
func (*SQLiteKVS) LoadOrStore ¶ added in v0.7.6
func (*SQLiteKVS) StoreAsString ¶ added in v0.7.6
type SQLiteKVSCfg ¶ added in v0.7.6
type SQLiteKVSCfg struct {
Path string `json:"path" yaml:"path" validate:"required"`
Table string `json:"table" yaml:"table"`
PoolSize int `json:"poolSize" yaml:"poolSize"`
}
func NewSQLiteKVSCfg ¶ added in v0.7.6
func NewSQLiteKVSCfg() *SQLiteKVSCfg
Click to show internal directories.
Click to hide internal directories.