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 PLoadAsBool(kvs NoErrKVS, k string) bool
- func PLoadAsFloat(kvs NoErrKVS, k string) float64
- func PLoadAsFloatOr(kvs NoErrKVS, k string, d float64) float64
- func PLoadAsInt(kvs NoErrKVS, k string) int
- func PLoadAsIntOr(kvs NoErrKVS, k string, d int) int
- func PLoadAsString(kvs NoErrKVS, k string) string
- func PLoadAsStringOr(kvs NoErrKVS, k string, d string) string
- func PLoadAsUint(kvs NoErrKVS, k string) uint
- func PLoadAsUintOr(kvs NoErrKVS, k string, d uint) uint
- type Cfg
- type KVS
- type MapKVS
- func (m *MapKVS) Collect() map[string]any
- func (m *MapKVS) CollectAsString() map[string]string
- func (m *MapKVS) Del(k string)
- func (m *MapKVS) GetCfg() interface{}
- func (m *MapKVS) Load(k string) (any, bool)
- func (m *MapKVS) LoadAndDelete(k string) (any, bool)
- func (m *MapKVS) LoadAsBool(k string) bool
- func (m *MapKVS) LoadAsFloat(k string) float64
- func (m *MapKVS) LoadAsFloatOr(k string, d float64) float64
- func (m *MapKVS) LoadAsInt(k string) int
- func (m *MapKVS) LoadAsIntOr(k string, d int) int
- func (m *MapKVS) LoadAsString(k string) string
- func (m *MapKVS) LoadAsStringOr(k string, d string) string
- func (m *MapKVS) LoadAsUint(k string) uint
- func (m *MapKVS) LoadAsUintOr(k string, d uint) uint
- func (m *MapKVS) LoadOrStore(k string, v any) (any, bool)
- func (m *MapKVS) Range(f func(k string, v any) bool)
- func (m *MapKVS) Store(k string, v any)
- func (m *MapKVS) StoreAsString(k string, v any)
- func (m *MapKVS) Type() interface{}
- type MapKVSCfg
- type NoErrKVS
- 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
func PLoadAsBool ¶ added in v0.8.1
func PLoadAsFloat ¶ added in v0.8.1
func PLoadAsFloatOr ¶ added in v0.8.1
func PLoadAsInt ¶ added in v0.8.1
func PLoadAsString ¶ added in v0.8.1
func PLoadAsStringOr ¶ added in v0.8.1
func PLoadAsUint ¶ added in v0.8.1
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 MapKVS ¶ added in v0.8.1
type MapKVS struct { *MapKVSCfg // contains filtered or unexported fields }
func (*MapKVS) CollectAsString ¶ added in v0.8.1
func (*MapKVS) LoadAsBool ¶ added in v0.8.1
func (*MapKVS) LoadAsFloat ¶ added in v0.8.1
func (*MapKVS) LoadAsFloatOr ¶ added in v0.8.1
func (*MapKVS) LoadAsString ¶ added in v0.8.1
func (*MapKVS) LoadAsStringOr ¶ added in v0.8.1
func (*MapKVS) LoadAsUint ¶ added in v0.8.1
func (*MapKVS) LoadOrStore ¶ added in v0.8.1
func (*MapKVS) StoreAsString ¶ added in v0.8.1
type MapKVSCfg ¶ added in v0.8.1
type MapKVSCfg struct{}
func NewMapKVSCfg ¶ added in v0.8.1
func NewMapKVSCfg() *MapKVSCfg
type NoErrKVS ¶ added in v0.8.1
type NoErrKVS interface { plugin.Plugin Store(k string, v any) StoreAsString(k string, v 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 Collect() map[string]any CollectAsString() map[string]string Range(func(k string, v any) bool) }
NoErrKVS ignore KVS method returned error.
Click to show internal directories.
Click to hide internal directories.