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)
- type Cfg
- type DBModel
- type KVS
- type MemKVS
- func (i *MemKVS) Close() error
- func (i *MemKVS) Collect() (map[string]any, error)
- func (i *MemKVS) CollectAsString() (map[string]string, error)
- func (i *MemKVS) Del(k string) error
- func (i *MemKVS) GetCfg() interface{}
- func (i *MemKVS) Load(k string) (any, bool, error)
- func (i *MemKVS) LoadAndDelete(k string) (any, bool, error)
- func (i *MemKVS) LoadAsBool(k string) (bool, error)
- func (i *MemKVS) LoadAsFloat(k string) (float64, error)
- func (i *MemKVS) LoadAsFloatOr(k string, d float64) (float64, error)
- func (i *MemKVS) LoadAsInt(k string) (int, error)
- func (i *MemKVS) LoadAsIntOr(k string, d int) (int, error)
- func (i *MemKVS) LoadAsString(k string) (string, error)
- func (i *MemKVS) LoadAsStringOr(k string, d string) (string, error)
- func (i *MemKVS) LoadAsUint(k string) (uint, error)
- func (i *MemKVS) LoadAsUintOr(k string, d uint) (uint, error)
- func (i *MemKVS) LoadOrStore(k string, v any) (any, bool, error)
- func (i *MemKVS) Open() error
- func (i *MemKVS) Range(f func(k string, v any) bool) error
- func (i *MemKVS) Store(k string, v any) error
- func (i *MemKVS) StoreAsString(k string, v any) error
- func (i *MemKVS) Type() interface{}
- type MemKVSCfg
- 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) 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 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) Collect() (map[string]any, error) CollectAsString() (map[string]string, error) Range(func(k string, v any) bool) error }
type MemKVS ¶ added in v0.7.7
type MemKVS struct { *MemKVSCfg // contains filtered or unexported fields }
func (*MemKVS) CollectAsString ¶ added in v0.7.7
func (*MemKVS) LoadAndDelete ¶ added in v0.7.7
func (*MemKVS) LoadAsFloat ¶ added in v0.7.7
func (*MemKVS) LoadAsFloatOr ¶ added in v0.7.7
func (*MemKVS) LoadAsIntOr ¶ added in v0.7.7
func (*MemKVS) LoadAsString ¶ added in v0.7.7
func (*MemKVS) LoadAsStringOr ¶ added in v0.7.7
func (*MemKVS) LoadAsUintOr ¶ added in v0.7.7
func (*MemKVS) LoadOrStore ¶ added in v0.7.7
func (*MemKVS) StoreAsString ¶ added in v0.7.7
type MemKVSCfg ¶ added in v0.7.7
type MemKVSCfg struct{}
func NewMemKVSCfg ¶ added in v0.7.7
func NewMemKVSCfg() *MemKVSCfg
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.