Documentation
¶
Index ¶
- type Dictionary
- type KV
- func (k KV) Bool(key string, def ...bool) bool
- func (k KV) Duration(key string, def ...time.Duration) time.Duration
- func (k KV) Float(key string, def ...float64) float64
- func (k KV) Int(key string, def ...int) int
- func (k KV) String(key string, def ...string) string
- func (k KV) Time(key string, def ...time.Time) time.Time
- func (k KV) Uint(key string, def ...uint) uint
- func (k KV) V(key string) RVariant
- type RVariant
- type Scalar
- type Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dictionary ¶
func (Dictionary) Get ¶
func (d Dictionary) Get(key string) Variant
func (Dictionary) Set ¶
func (d Dictionary) Set(key string, v any)
type RVariant ¶
type RVariant interface {
IsNil() bool
IsZero() bool
Uint8E() (uint8, error)
Uint16E() (uint16, error)
Uint32E() (uint32, error)
Uint64E() (uint64, error)
UintE() (uint, error)
Int8E() (int8, error)
Int16E() (int16, error)
Int32E() (int32, error)
Int64E() (int64, error)
IntE() (int, error)
ByteE() (byte, error)
Float32E() (float32, error)
Float64E() (float64, error)
BoolE() (bool, error)
StringE() (string, error)
DurationE() (time.Duration, error)
TimeE() (time.Time, error)
Interface() any
Uint8() uint8
Uint16() uint16
Uint32() uint32
Uint64() uint64
Uint() uint
Int8() int8
Int16() int16
Int32() int32
Int64() int64
Int() int
Byte() byte
Float32() float32
Float64() float64
Bool() bool
String() string
Duration() time.Duration
Time() time.Time
Value() (driver.Value, error)
MarshalJSON() ([]byte, error)
}
RVariant holds various value and handle type conversion.
For conversion to time.Duration and time.Time, if value type is floating point, e.g. nnn.fff then nnn will be treated as seconds, while fff will be treated as nano seconds.
func NewRVariant ¶
func NewRVariant(i interface{}) RVariant
NewRVariant create readonly variant from given value
type Scalar ¶
type Scalar interface {
constraints.Float | constraints.Integer
}
Scalar number constraint
Click to show internal directories.
Click to hide internal directories.