Documentation ¶
Overview ¶
Value package defines the core value types (string, int, etc) for the qlbridge package, mostly used to provide common interfaces instead of reflection for virtual machine.
Index ¶
- Variables
- func BoolStringVal(sv string) bool
- func Equal(l, r Value) (bool, error)
- func IsBool(sv string) bool
- func StringToFloat64(s string) (float64, bool)
- func StringToTimeAnchor(val string, anchor time.Time) (time.Time, bool)
- func ValueToBool(val Value) (bool, bool)
- func ValueToFloat64(val Value) (float64, bool)
- func ValueToInt(val Value) (int, bool)
- func ValueToInt64(val Value) (int64, bool)
- func ValueToString(val Value) (string, bool)
- func ValueToStrings(val Value) ([]string, bool)
- func ValueToTime(val Value) (time.Time, bool)
- func ValueToTimeAnchor(val Value, anchor time.Time) (time.Time, bool)
- type BoolValue
- type ByteSliceValue
- func (m ByteSliceValue) Err() bool
- func (m ByteSliceValue) Len() int
- func (m ByteSliceValue) MarshalJSON() ([]byte, error)
- func (m ByteSliceValue) Nil() bool
- func (m ByteSliceValue) ToString() string
- func (m ByteSliceValue) Type() ValueType
- func (m ByteSliceValue) Val() []byte
- func (m ByteSliceValue) Value() interface{}
- type ErrorValue
- type IntValue
- func (m IntValue) Err() bool
- func (m IntValue) Float() float64
- func (m IntValue) Int() int64
- func (m IntValue) MarshalJSON() ([]byte, error)
- func (m IntValue) Nil() bool
- func (m IntValue) NumberValue() NumberValue
- func (m IntValue) ToString() string
- func (m IntValue) Type() ValueType
- func (m IntValue) Val() int64
- func (m IntValue) Value() interface{}
- type JsonValue
- type Map
- type MapBoolValue
- func (m MapBoolValue) Err() bool
- func (m MapBoolValue) Get(key string) (Value, bool)
- func (m MapBoolValue) Len() int
- func (m MapBoolValue) MapValue() MapValue
- func (m MapBoolValue) MarshalJSON() ([]byte, error)
- func (m MapBoolValue) Nil() bool
- func (m MapBoolValue) SliceValue() []Value
- func (m MapBoolValue) ToString() string
- func (m MapBoolValue) Type() ValueType
- func (m MapBoolValue) Val() map[string]bool
- func (m MapBoolValue) Value() interface{}
- type MapIntValue
- func (m MapIntValue) Err() bool
- func (m MapIntValue) Get(key string) (Value, bool)
- func (m MapIntValue) Len() int
- func (m MapIntValue) MapFloat() map[string]float64
- func (m MapIntValue) MapInt() map[string]int64
- func (m MapIntValue) MapValue() MapValue
- func (m MapIntValue) MarshalJSON() ([]byte, error)
- func (m MapIntValue) Nil() bool
- func (m MapIntValue) SliceValue() []Value
- func (m MapIntValue) ToString() string
- func (m MapIntValue) Type() ValueType
- func (m MapIntValue) Val() map[string]int64
- func (m MapIntValue) Value() interface{}
- type MapNumberValue
- func (m MapNumberValue) Err() bool
- func (m MapNumberValue) Get(key string) (Value, bool)
- func (m MapNumberValue) Len() int
- func (m MapNumberValue) MapInt() map[string]int64
- func (m MapNumberValue) MapValue() MapValue
- func (m MapNumberValue) MarshalJSON() ([]byte, error)
- func (m MapNumberValue) Nil() bool
- func (m MapNumberValue) SliceValue() []Value
- func (m MapNumberValue) ToString() string
- func (m MapNumberValue) Type() ValueType
- func (m MapNumberValue) Val() map[string]float64
- func (m MapNumberValue) Value() interface{}
- type MapStringValue
- func (m MapStringValue) Err() bool
- func (m MapStringValue) Get(key string) (Value, bool)
- func (m MapStringValue) Len() int
- func (m MapStringValue) MapBool() MapBoolValue
- func (m MapStringValue) MapInt() MapIntValue
- func (m MapStringValue) MapNumber() MapNumberValue
- func (m MapStringValue) MapValue() MapValue
- func (m MapStringValue) MarshalJSON() ([]byte, error)
- func (m MapStringValue) Nil() bool
- func (m MapStringValue) SliceValue() []Value
- func (m MapStringValue) ToString() string
- func (m MapStringValue) Type() ValueType
- func (m MapStringValue) Val() map[string]string
- func (m MapStringValue) Value() interface{}
- type MapTimeValue
- func (m MapTimeValue) Err() bool
- func (m MapTimeValue) Get(key string) (Value, bool)
- func (m MapTimeValue) Len() int
- func (m MapTimeValue) MapInt() map[string]int64
- func (m MapTimeValue) MapValue() MapValue
- func (m MapTimeValue) MarshalJSON() ([]byte, error)
- func (m MapTimeValue) Nil() bool
- func (m MapTimeValue) ToString() string
- func (m MapTimeValue) Type() ValueType
- func (m MapTimeValue) Val() map[string]time.Time
- func (m MapTimeValue) Value() interface{}
- type MapValue
- func (m MapValue) Err() bool
- func (m MapValue) Get(key string) (Value, bool)
- func (m MapValue) Len() int
- func (m MapValue) MapFloat() map[string]float64
- func (m MapValue) MapInt() map[string]int64
- func (m MapValue) MapString() map[string]string
- func (m MapValue) MapTime() MapTimeValue
- func (m MapValue) MapValue() MapValue
- func (m MapValue) MarshalJSON() ([]byte, error)
- func (m MapValue) Nil() bool
- func (m MapValue) ToString() string
- func (m MapValue) Type() ValueType
- func (m MapValue) Val() map[string]Value
- func (m MapValue) Value() interface{}
- type NilValue
- type NumberValue
- func (m NumberValue) Err() bool
- func (m NumberValue) Float() float64
- func (m NumberValue) Int() int64
- func (m NumberValue) MarshalJSON() ([]byte, error)
- func (m NumberValue) Nil() bool
- func (m NumberValue) ToString() string
- func (m NumberValue) Type() ValueType
- func (m NumberValue) Val() float64
- func (m NumberValue) Value() interface{}
- type NumericValue
- type Slice
- type SliceValue
- func (m *SliceValue) Append(v Value)
- func (m SliceValue) Err() bool
- func (m SliceValue) Len() int
- func (m SliceValue) MarshalJSON() ([]byte, error)
- func (m SliceValue) Nil() bool
- func (m SliceValue) SliceValue() []Value
- func (m SliceValue) ToString() string
- func (m SliceValue) Type() ValueType
- func (m SliceValue) Val() []Value
- func (m SliceValue) Value() interface{}
- func (m SliceValue) Values() []interface{}
- type StringValue
- func (m StringValue) Err() bool
- func (m StringValue) IntValue() IntValue
- func (m StringValue) MarshalJSON() ([]byte, error)
- func (m StringValue) Nil() bool
- func (m StringValue) NumberValue() NumberValue
- func (m StringValue) StringsValue() StringsValue
- func (m StringValue) ToString() string
- func (m StringValue) Type() ValueType
- func (m StringValue) Val() string
- func (m StringValue) Value() interface{}
- type StringsValue
- func (m *StringsValue) Append(sv string)
- func (m StringsValue) Err() bool
- func (m StringsValue) IntValue() IntValue
- func (m StringsValue) Len() int
- func (m StringsValue) MarshalJSON() ([]byte, error)
- func (m StringsValue) Nil() bool
- func (m StringsValue) NumberValue() NumberValue
- func (m StringsValue) Set() map[string]struct{}
- func (m StringsValue) SliceValue() []Value
- func (m StringsValue) Strings() []string
- func (m StringsValue) ToString() string
- func (m StringsValue) Type() ValueType
- func (m StringsValue) Val() []string
- func (m StringsValue) Value() interface{}
- type StructValue
- type TimeValue
- func (m TimeValue) Err() bool
- func (m TimeValue) Float() float64
- func (m TimeValue) Int() int64
- func (m TimeValue) MarshalJSON() ([]byte, error)
- func (m TimeValue) Nil() bool
- func (m TimeValue) Time() time.Time
- func (m TimeValue) ToString() string
- func (m TimeValue) Type() ValueType
- func (m TimeValue) Val() time.Time
- func (m TimeValue) Value() interface{}
- type Value
- type ValueType
Constants ¶
This section is empty.
Variables ¶
var ( ErrConversion = fmt.Errorf("Error converting type") ErrConversionNotSupported = fmt.Errorf("Unsupported conversion") )
var ( EmptyStruct = struct{}{} NilValueVal = NewNilValue() BoolValueTrue = BoolValue{/* contains filtered or unexported fields */} BoolValueFalse = BoolValue{/* contains filtered or unexported fields */} NumberNaNValue = NewNumberValue(math.NaN()) EmptyStringValue = NewStringValue("") EmptyStringsValue = NewStringsValue(nil) EmptyMapValue = NewMapValue(nil) EmptyMapStringValue = NewMapStringValue(make(map[string]string)) EmptyMapIntValue = NewMapIntValue(make(map[string]int64)) EmptyMapNumberValue = NewMapNumberValue(make(map[string]float64)) EmptyMapTimeValue = NewMapTimeValue(make(map[string]time.Time)) EmptyMapBoolValue = NewMapBoolValue(make(map[string]bool)) NilStructValue = NewStructValue(nilStruct) TimeZeroValue = NewTimeValue(time.Time{}) ErrValue = NewErrorValue(fmt.Errorf("")) )
Functions ¶
func BoolStringVal ¶
func StringToFloat64 ¶
StringToFloat64 converts a string to a float includes replacement of $ and other monetary format identifiers. May return math.NaN
func StringToTimeAnchor ¶
StringToTimeAnchor Convert a string type to a time if possible. If "now-3d" then use date-anchoring ie if prefix = 'now'.
func ValueToBool ¶
ValueToBool Convert a value type to a bool if possible
func ValueToFloat64 ¶
ValueToFloat64 Convert a value type to a float64 if possible
func ValueToInt ¶
ValueToInt Convert a value type to a int if possible
func ValueToInt64 ¶
ValueToInt64 Convert a value type to a int64 if possible
func ValueToString ¶
ValueToString convert all scalar values to their go string.
func ValueToStrings ¶
ValueToStrings convert all scalar values to their go []string.
func ValueToTime ¶
ValueToTime Convert a value type to a time if possible
Types ¶
type BoolValue ¶
type BoolValue struct {
// contains filtered or unexported fields
}
func NewBoolValue ¶
func (BoolValue) MarshalJSON ¶
type ByteSliceValue ¶
type ByteSliceValue struct {
// contains filtered or unexported fields
}
func NewByteSliceValue ¶
func NewByteSliceValue(v []byte) ByteSliceValue
func (ByteSliceValue) Err ¶
func (m ByteSliceValue) Err() bool
func (ByteSliceValue) Len ¶
func (m ByteSliceValue) Len() int
func (ByteSliceValue) MarshalJSON ¶
func (m ByteSliceValue) MarshalJSON() ([]byte, error)
func (ByteSliceValue) Nil ¶
func (m ByteSliceValue) Nil() bool
func (ByteSliceValue) ToString ¶
func (m ByteSliceValue) ToString() string
func (ByteSliceValue) Type ¶
func (m ByteSliceValue) Type() ValueType
func (ByteSliceValue) Val ¶
func (m ByteSliceValue) Val() []byte
func (ByteSliceValue) Value ¶
func (m ByteSliceValue) Value() interface{}
type ErrorValue ¶
type ErrorValue struct {
// contains filtered or unexported fields
}
func NewErrorValue ¶
func NewErrorValue(v error) ErrorValue
func NewErrorValuef ¶
func NewErrorValuef(v string, args ...interface{}) ErrorValue
func (ErrorValue) Err ¶
func (m ErrorValue) Err() bool
func (ErrorValue) Error ¶
func (m ErrorValue) Error() string
ErrorValues implement Go's error interface so they can easily cross the VM/Go boundary.
func (ErrorValue) MarshalJSON ¶
func (m ErrorValue) MarshalJSON() ([]byte, error)
func (ErrorValue) Nil ¶
func (m ErrorValue) Nil() bool
func (ErrorValue) ToString ¶
func (m ErrorValue) ToString() string
func (ErrorValue) Type ¶
func (m ErrorValue) Type() ValueType
func (ErrorValue) Val ¶
func (m ErrorValue) Val() error
func (ErrorValue) Value ¶
func (m ErrorValue) Value() interface{}
type IntValue ¶
type IntValue struct {
// contains filtered or unexported fields
}
func NewIntValue ¶
func (IntValue) MarshalJSON ¶
func (IntValue) NumberValue ¶
func (m IntValue) NumberValue() NumberValue
type JsonValue ¶
type JsonValue struct {
// contains filtered or unexported fields
}
func NewJsonValue ¶
func NewJsonValue(v json.RawMessage) JsonValue
func (JsonValue) MarshalJSON ¶
type MapBoolValue ¶
type MapBoolValue struct {
// contains filtered or unexported fields
}
func NewMapBoolValue ¶
func NewMapBoolValue(v map[string]bool) MapBoolValue
func (MapBoolValue) Err ¶
func (m MapBoolValue) Err() bool
func (MapBoolValue) Len ¶
func (m MapBoolValue) Len() int
func (MapBoolValue) MapValue ¶
func (m MapBoolValue) MapValue() MapValue
func (MapBoolValue) MarshalJSON ¶
func (m MapBoolValue) MarshalJSON() ([]byte, error)
func (MapBoolValue) Nil ¶
func (m MapBoolValue) Nil() bool
func (MapBoolValue) SliceValue ¶
func (m MapBoolValue) SliceValue() []Value
func (MapBoolValue) ToString ¶
func (m MapBoolValue) ToString() string
func (MapBoolValue) Type ¶
func (m MapBoolValue) Type() ValueType
func (MapBoolValue) Val ¶
func (m MapBoolValue) Val() map[string]bool
func (MapBoolValue) Value ¶
func (m MapBoolValue) Value() interface{}
type MapIntValue ¶
type MapIntValue struct {
// contains filtered or unexported fields
}
func NewMapIntValue ¶
func NewMapIntValue(v map[string]int64) MapIntValue
func (MapIntValue) Err ¶
func (m MapIntValue) Err() bool
func (MapIntValue) Len ¶
func (m MapIntValue) Len() int
func (MapIntValue) MapFloat ¶
func (m MapIntValue) MapFloat() map[string]float64
func (MapIntValue) MapInt ¶
func (m MapIntValue) MapInt() map[string]int64
func (MapIntValue) MapValue ¶
func (m MapIntValue) MapValue() MapValue
func (MapIntValue) MarshalJSON ¶
func (m MapIntValue) MarshalJSON() ([]byte, error)
func (MapIntValue) Nil ¶
func (m MapIntValue) Nil() bool
func (MapIntValue) SliceValue ¶
func (m MapIntValue) SliceValue() []Value
func (MapIntValue) ToString ¶
func (m MapIntValue) ToString() string
func (MapIntValue) Type ¶
func (m MapIntValue) Type() ValueType
func (MapIntValue) Val ¶
func (m MapIntValue) Val() map[string]int64
func (MapIntValue) Value ¶
func (m MapIntValue) Value() interface{}
type MapNumberValue ¶
type MapNumberValue struct {
// contains filtered or unexported fields
}
func NewMapNumberValue ¶
func NewMapNumberValue(v map[string]float64) MapNumberValue
func (MapNumberValue) Err ¶
func (m MapNumberValue) Err() bool
func (MapNumberValue) Len ¶
func (m MapNumberValue) Len() int
func (MapNumberValue) MapInt ¶
func (m MapNumberValue) MapInt() map[string]int64
func (MapNumberValue) MapValue ¶
func (m MapNumberValue) MapValue() MapValue
func (MapNumberValue) MarshalJSON ¶
func (m MapNumberValue) MarshalJSON() ([]byte, error)
func (MapNumberValue) Nil ¶
func (m MapNumberValue) Nil() bool
func (MapNumberValue) SliceValue ¶
func (m MapNumberValue) SliceValue() []Value
func (MapNumberValue) ToString ¶
func (m MapNumberValue) ToString() string
func (MapNumberValue) Type ¶
func (m MapNumberValue) Type() ValueType
func (MapNumberValue) Val ¶
func (m MapNumberValue) Val() map[string]float64
func (MapNumberValue) Value ¶
func (m MapNumberValue) Value() interface{}
type MapStringValue ¶
type MapStringValue struct {
// contains filtered or unexported fields
}
func NewMapStringValue ¶
func NewMapStringValue(v map[string]string) MapStringValue
func (MapStringValue) Err ¶
func (m MapStringValue) Err() bool
func (MapStringValue) Len ¶
func (m MapStringValue) Len() int
func (MapStringValue) MapBool ¶
func (m MapStringValue) MapBool() MapBoolValue
func (MapStringValue) MapInt ¶
func (m MapStringValue) MapInt() MapIntValue
func (MapStringValue) MapNumber ¶
func (m MapStringValue) MapNumber() MapNumberValue
func (MapStringValue) MapValue ¶
func (m MapStringValue) MapValue() MapValue
func (MapStringValue) MarshalJSON ¶
func (m MapStringValue) MarshalJSON() ([]byte, error)
func (MapStringValue) Nil ¶
func (m MapStringValue) Nil() bool
func (MapStringValue) SliceValue ¶
func (m MapStringValue) SliceValue() []Value
func (MapStringValue) ToString ¶
func (m MapStringValue) ToString() string
func (MapStringValue) Type ¶
func (m MapStringValue) Type() ValueType
func (MapStringValue) Val ¶
func (m MapStringValue) Val() map[string]string
func (MapStringValue) Value ¶
func (m MapStringValue) Value() interface{}
type MapTimeValue ¶
type MapTimeValue struct {
// contains filtered or unexported fields
}
func NewMapTimeValue ¶
func NewMapTimeValue(v map[string]time.Time) MapTimeValue
func (MapTimeValue) Err ¶
func (m MapTimeValue) Err() bool
func (MapTimeValue) Len ¶
func (m MapTimeValue) Len() int
func (MapTimeValue) MapInt ¶
func (m MapTimeValue) MapInt() map[string]int64
func (MapTimeValue) MapValue ¶
func (m MapTimeValue) MapValue() MapValue
func (MapTimeValue) MarshalJSON ¶
func (m MapTimeValue) MarshalJSON() ([]byte, error)
func (MapTimeValue) Nil ¶
func (m MapTimeValue) Nil() bool
func (MapTimeValue) ToString ¶
func (m MapTimeValue) ToString() string
func (MapTimeValue) Type ¶
func (m MapTimeValue) Type() ValueType
func (MapTimeValue) Value ¶
func (m MapTimeValue) Value() interface{}
type MapValue ¶
type MapValue struct {
// contains filtered or unexported fields
}
func NewMapValue ¶
func (MapValue) MapTime ¶
func (m MapValue) MapTime() MapTimeValue
func (MapValue) MarshalJSON ¶
type NilValue ¶
type NilValue struct{}
func NewNilValue ¶
func NewNilValue() NilValue
func (NilValue) MarshalJSON ¶
type NumberValue ¶
type NumberValue struct {
// contains filtered or unexported fields
}
func NewNumberNil ¶
func NewNumberNil() NumberValue
func NewNumberValue ¶
func NewNumberValue(v float64) NumberValue
func (NumberValue) Err ¶
func (m NumberValue) Err() bool
func (NumberValue) Float ¶
func (m NumberValue) Float() float64
func (NumberValue) Int ¶
func (m NumberValue) Int() int64
func (NumberValue) MarshalJSON ¶
func (m NumberValue) MarshalJSON() ([]byte, error)
func (NumberValue) Nil ¶
func (m NumberValue) Nil() bool
func (NumberValue) ToString ¶
func (m NumberValue) ToString() string
func (NumberValue) Type ¶
func (m NumberValue) Type() ValueType
func (NumberValue) Val ¶
func (m NumberValue) Val() float64
func (NumberValue) Value ¶
func (m NumberValue) Value() interface{}
type NumericValue ¶
Certain types are Numeric (Ints, Time, Number)
type Slice ¶
Slices can always return a []Value representation and is meant to be used when iterating over all items in a non-scalar value. Maps return their keys as a slice.
type SliceValue ¶
type SliceValue struct {
// contains filtered or unexported fields
}
func NewSliceValues ¶
func NewSliceValues(v []Value) SliceValue
func NewSliceValuesNative ¶
func NewSliceValuesNative(iv []interface{}) SliceValue
func (*SliceValue) Append ¶
func (m *SliceValue) Append(v Value)
func (SliceValue) Err ¶
func (m SliceValue) Err() bool
func (SliceValue) Len ¶
func (m SliceValue) Len() int
func (SliceValue) MarshalJSON ¶
func (m SliceValue) MarshalJSON() ([]byte, error)
func (SliceValue) Nil ¶
func (m SliceValue) Nil() bool
func (SliceValue) SliceValue ¶
func (m SliceValue) SliceValue() []Value
func (SliceValue) ToString ¶
func (m SliceValue) ToString() string
func (SliceValue) Type ¶
func (m SliceValue) Type() ValueType
func (SliceValue) Val ¶
func (m SliceValue) Val() []Value
func (SliceValue) Value ¶
func (m SliceValue) Value() interface{}
func (SliceValue) Values ¶
func (m SliceValue) Values() []interface{}
type StringValue ¶
type StringValue struct {
// contains filtered or unexported fields
}
func NewStringValue ¶
func NewStringValue(v string) StringValue
func (StringValue) Err ¶
func (m StringValue) Err() bool
func (StringValue) IntValue ¶
func (m StringValue) IntValue() IntValue
func (StringValue) MarshalJSON ¶
func (m StringValue) MarshalJSON() ([]byte, error)
func (StringValue) Nil ¶
func (m StringValue) Nil() bool
func (StringValue) NumberValue ¶
func (m StringValue) NumberValue() NumberValue
func (StringValue) StringsValue ¶
func (m StringValue) StringsValue() StringsValue
func (StringValue) ToString ¶
func (m StringValue) ToString() string
func (StringValue) Type ¶
func (m StringValue) Type() ValueType
func (StringValue) Val ¶
func (m StringValue) Val() string
func (StringValue) Value ¶
func (m StringValue) Value() interface{}
type StringsValue ¶
type StringsValue struct {
// contains filtered or unexported fields
}
func NewStringsValue ¶
func NewStringsValue(v []string) StringsValue
func (*StringsValue) Append ¶
func (m *StringsValue) Append(sv string)
func (StringsValue) Err ¶
func (m StringsValue) Err() bool
func (StringsValue) IntValue ¶
func (m StringsValue) IntValue() IntValue
func (StringsValue) Len ¶
func (m StringsValue) Len() int
func (StringsValue) MarshalJSON ¶
func (m StringsValue) MarshalJSON() ([]byte, error)
func (StringsValue) Nil ¶
func (m StringsValue) Nil() bool
func (StringsValue) NumberValue ¶
func (m StringsValue) NumberValue() NumberValue
func (StringsValue) Set ¶
func (m StringsValue) Set() map[string]struct{}
func (StringsValue) SliceValue ¶
func (m StringsValue) SliceValue() []Value
func (StringsValue) Strings ¶
func (m StringsValue) Strings() []string
func (StringsValue) ToString ¶
func (m StringsValue) ToString() string
func (StringsValue) Type ¶
func (m StringsValue) Type() ValueType
func (StringsValue) Val ¶
func (m StringsValue) Val() []string
func (StringsValue) Value ¶
func (m StringsValue) Value() interface{}
type StructValue ¶
type StructValue struct {
// contains filtered or unexported fields
}
func NewStructValue ¶
func NewStructValue(v interface{}) StructValue
func (StructValue) Err ¶
func (m StructValue) Err() bool
func (StructValue) MarshalJSON ¶
func (m StructValue) MarshalJSON() ([]byte, error)
func (StructValue) Nil ¶
func (m StructValue) Nil() bool
func (StructValue) ToString ¶
func (m StructValue) ToString() string
func (StructValue) Type ¶
func (m StructValue) Type() ValueType
func (StructValue) Val ¶
func (m StructValue) Val() interface{}
func (StructValue) Value ¶
func (m StructValue) Value() interface{}
type TimeValue ¶
type TimeValue struct {
// contains filtered or unexported fields
}
func NewTimeValue ¶
func (TimeValue) MarshalJSON ¶
type Value ¶
type ValueType ¶
type ValueType uint8
This is the DataType system, ie string, int, etc
const ( // Enum values for Type system, DO NOT CHANGE the numbers, do not use iota NilType ValueType = 0 ErrorType ValueType = 1 UnknownType ValueType = 2 ValueInterfaceType ValueType = 3 // Is of type Value Interface, ie unknown NumberType ValueType = 10 IntType ValueType = 11 BoolType ValueType = 12 TimeType ValueType = 13 ByteSliceType ValueType = 14 StringType ValueType = 20 StringsType ValueType = 21 MapValueType ValueType = 30 MapIntType ValueType = 31 MapStringType ValueType = 32 MapNumberType ValueType = 33 MapBoolType ValueType = 34 MapTimeType ValueType = 35 SliceValueType ValueType = 40 StructType ValueType = 50 JsonType ValueType = 51 )
func ValueFromString ¶
ValueFromString Given a string, convert to valuetype
func ValueTypeFromString ¶
ValueTypeFromString take a string value and infer valuetype Will infer based on the following rules: - If parseable as int, will be int - if not above, and parse bool, is bool - if not above, and parse float, float - if not above, and parse date, date - else string
func ValueTypeFromStringAll ¶
ValueTypeFromStringAll take a string value and infer valuetype adding the valid type JSON preferred over raw string.
Will infer based on the following rules: - If parseable as int, will be int - if not above, and parse bool, is bool - if not above, and parse float, float - if not above, and parse date, date - if not above, and appears to be json (doesn't have to be valid) - else string