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 SQLite3KVS
- func (s *SQLite3KVS) Close() error
- func (s *SQLite3KVS) Collect() (map[string]any, error)
- func (s *SQLite3KVS) CollectAsString() (map[string]string, error)
- func (s *SQLite3KVS) Del(k string) error
- func (s *SQLite3KVS) GetCfg() interface{}
- func (s *SQLite3KVS) Load(k string) (any, bool, error)
- func (s *SQLite3KVS) LoadAndDelete(k string) (any, bool, error)
- func (s *SQLite3KVS) LoadAsBool(k string) (bool, error)
- func (s *SQLite3KVS) LoadAsFloat(k string) (float64, error)
- func (s *SQLite3KVS) LoadAsFloatOr(k string, d float64) (float64, error)
- func (s *SQLite3KVS) LoadAsInt(k string) (int, error)
- func (s *SQLite3KVS) LoadAsIntOr(k string, d int) (int, error)
- func (s *SQLite3KVS) LoadAsString(k string) (string, error)
- func (s *SQLite3KVS) LoadAsStringOr(k string, d string) (string, error)
- func (s *SQLite3KVS) LoadAsUint(k string) (uint, error)
- func (s *SQLite3KVS) LoadAsUintOr(k string, d uint) (uint, error)
- func (s *SQLite3KVS) LoadOrStore(k string, v any) (any, bool, error)
- func (s *SQLite3KVS) LoadTo(k string, to any) error
- func (s *SQLite3KVS) Open() error
- func (s *SQLite3KVS) Range(f func(k string, v any) bool) error
- func (s *SQLite3KVS) Store(k string, v any) error
- func (s *SQLite3KVS) StoreAsString(k string, v any) error
- func (s *SQLite3KVS) Type() interface{}
- type SQLite3KVSCfg
- 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 (*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
}
func NewInMemKVS ¶
func NewInMemKVS() KVS
func NewSQLite3KVS ¶ added in v0.7.5
func NewSQLite3KVS() KVS
type SQLite3KVS ¶ added in v0.7.5
type SQLite3KVS struct {
*SQLite3KVSCfg
// contains filtered or unexported fields
}
func (*SQLite3KVS) Close ¶ added in v0.7.5
func (s *SQLite3KVS) Close() error
func (*SQLite3KVS) CollectAsString ¶ added in v0.7.5
func (s *SQLite3KVS) CollectAsString() (map[string]string, error)
func (*SQLite3KVS) Del ¶ added in v0.7.5
func (s *SQLite3KVS) Del(k string) error
func (*SQLite3KVS) GetCfg ¶ added in v0.7.5
func (s *SQLite3KVS) GetCfg() interface{}
func (*SQLite3KVS) LoadAndDelete ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAndDelete(k string) (any, bool, error)
func (*SQLite3KVS) LoadAsBool ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsBool(k string) (bool, error)
func (*SQLite3KVS) LoadAsFloat ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsFloat(k string) (float64, error)
func (*SQLite3KVS) LoadAsFloatOr ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsFloatOr(k string, d float64) (float64, error)
func (*SQLite3KVS) LoadAsInt ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsInt(k string) (int, error)
func (*SQLite3KVS) LoadAsIntOr ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsIntOr(k string, d int) (int, error)
func (*SQLite3KVS) LoadAsString ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsString(k string) (string, error)
func (*SQLite3KVS) LoadAsStringOr ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsStringOr(k string, d string) (string, error)
func (*SQLite3KVS) LoadAsUint ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsUint(k string) (uint, error)
func (*SQLite3KVS) LoadAsUintOr ¶ added in v0.7.5
func (s *SQLite3KVS) LoadAsUintOr(k string, d uint) (uint, error)
func (*SQLite3KVS) LoadOrStore ¶ added in v0.7.5
func (*SQLite3KVS) Open ¶ added in v0.7.5
func (s *SQLite3KVS) Open() error
func (*SQLite3KVS) Range ¶ added in v0.7.5
func (s *SQLite3KVS) Range(f func(k string, v any) bool) error
func (*SQLite3KVS) StoreAsString ¶ added in v0.7.5
func (s *SQLite3KVS) StoreAsString(k string, v any) error
func (*SQLite3KVS) Type ¶ added in v0.7.5
func (s *SQLite3KVS) Type() interface{}
type SQLite3KVSCfg ¶ added in v0.7.5
type SQLite3KVSCfg struct {
Path string `json:"path" yaml:"path" validate:"required"`
Table string `json:"table" yaml:"table"`
DDL string `json:"ddl" yaml:"ddl"`
}
func NewSQLite3KVSCfg ¶ added in v0.7.5
func NewSQLite3KVSCfg() *SQLite3KVSCfg
Click to show internal directories.
Click to hide internal directories.