Documentation ¶
Index ¶
- type Type
- type Value
- func Array(array interface{}) Value
- func Bool(v bool) Value
- func Float32(v float32) Value
- func Float64(v float64) Value
- func Int(v int) Value
- func Int32(v int32) Value
- func Int64(v int64) Value
- func String(v string) Value
- func Uint(v uint) Value
- func Uint32(v uint32) Value
- func Uint64(v uint64) Value
- func (v Value) AsArray() interface{}
- func (v Value) AsBool() bool
- func (v Value) AsFloat32() float32
- func (v Value) AsFloat64() float64
- func (v Value) AsInt32() int32
- func (v Value) AsInt64() int64
- func (v Value) AsInterface() interface{}
- func (v Value) AsString() string
- func (v Value) AsUint32() uint32
- func (v Value) AsUint64() uint64
- func (v Value) Emit() string
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) Type() Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Type ¶
type Type int
Type describes the type of the data Value holds.
const ( INVALID Type = iota // No value. BOOL // Boolean value, use AsBool() to get it. INT32 // 32 bit signed integral value, use AsInt32() to get it. INT64 // 64 bit signed integral value, use AsInt64() to get it. UINT32 // 32 bit unsigned integral value, use AsUint32() to get it. UINT64 // 64 bit unsigned integral value, use AsUint64() to get it. FLOAT32 // 32 bit floating point value, use AsFloat32() to get it. FLOAT64 // 64 bit floating point value, use AsFloat64() to get it. STRING // String value, use AsString() to get it. ARRAY // Array value of arbitrary type, use AsArray() to get it. )
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value represents the value part in key-value pairs.
func Int ¶
Int creates either an INT32 or an INT64 Value, depending on whether the int type is 32 or 64 bits wide.
func Uint ¶
Uint creates either a UINT32 or a UINT64 Value, depending on whether the uint type is 32 or 64 bits wide.
func (Value) AsArray ¶ added in v0.7.0
func (v Value) AsArray() interface{}
AsArray returns the array Value as an interface{}.
func (Value) AsFloat32 ¶
AsFloat32 returns the float32 value. Make sure that the Value's type is FLOAT32.
func (Value) AsFloat64 ¶
AsFloat64 returns the float64 value. Make sure that the Value's type is FLOAT64.
func (Value) AsInterface ¶
func (v Value) AsInterface() interface{}
AsInterface returns Value's data as interface{}.
func (Value) AsString ¶
AsString returns the string value. Make sure that the Value's type is STRING.
func (Value) AsUint32 ¶
AsUint32 returns the uint32 value. Make sure that the Value's type is UINT32.
func (Value) AsUint64 ¶
AsUint64 returns the uint64 value. Make sure that the Value's type is UINT64.
func (Value) MarshalJSON ¶
MarshalJSON returns the JSON encoding of the Value.