Documentation
¶
Overview ¶
Package ztype provides Variable Type Related Operations
Index ¶
- func AnyToDecimal(value string, base int) (v int)
- func DecimalToAny(value, base int) (newNumStr string)
- func GetType(s interface{}) string
- func InArray(needle, hystack interface{}) bool
- func IsBool(v interface{}) bool
- func IsByte(v interface{}) bool
- func IsEmpty(value interface{}) bool
- func IsFloat32(v interface{}) bool
- func IsFloat64(v interface{}) bool
- func IsInt(v interface{}) bool
- func IsInt16(v interface{}) bool
- func IsInt32(v interface{}) bool
- func IsInt64(v interface{}) bool
- func IsInt8(v interface{}) bool
- func IsInterface(v interface{}) bool
- func IsString(v interface{}) bool
- func IsStruct(v interface{}) bool
- func IsUint(v interface{}) bool
- func IsUint16(v interface{}) bool
- func IsUint32(v interface{}) bool
- func IsUint64(v interface{}) bool
- func IsUint8(v interface{}) bool
- func MapKeyExists(key interface{}, m map[interface{}]interface{}) bool
- func ReflectPtr(r reflect.Value) reflect.Value
- func SliceStrToIface(slice []string) []interface{}
- func ToBool(i interface{}) bool
- func ToBytes(i interface{}) []byte
- func ToFloat32(i interface{}) float32
- func ToFloat64(i interface{}) float64
- func ToInt(i interface{}) int
- func ToInt16(i interface{}) int16
- func ToInt32(i interface{}) int32
- func ToInt64(i interface{}) int64
- func ToInt8(i interface{}) int8
- func ToMapString(value interface{}, tags ...string) map[string]interface{}
- func ToMapStringDeep(value interface{}, tags ...string) map[string]interface{}
- func ToSliceMapString(value interface{}) []map[string]interface{}
- func ToString(i interface{}) string
- func ToTime(i interface{}, format ...string) (time.Time, error)
- func ToUint(i interface{}) uint
- func ToUint16(i interface{}) uint16
- func ToUint32(i interface{}) uint32
- func ToUint64(i interface{}) uint64
- func ToUint8(i interface{}) uint8
- type Map
- func (m *Map) Delete(key string) error
- func (m Map) Get(key string) *Type
- func (m *Map) GetToBool(key string, def ...bool) (val bool)
- func (m *Map) GetToBytes(key string, def ...[]byte) (val []byte)
- func (m *Map) GetToFloat32(key string, def ...float32) (val float32)
- func (m *Map) GetToFloat64(key string, def ...float64) (val float64)
- func (m *Map) GetToInt(key string, def ...int) (val int)
- func (m *Map) GetToInt16(key string, def ...int16) (val int16)
- func (m *Map) GetToInt32(key string, def ...int32) (val int32)
- func (m *Map) GetToInt64(key string, def ...int64) (val int64)
- func (m *Map) GetToInt8(key string, def ...int8) (val int8)
- func (m *Map) GetToMap(key string, def ...Map) (val Map)
- func (m *Map) GetToSlice(key string, def ...SliceType) (val SliceType)
- func (m *Map) GetToSliceValue(key string, def ...[]interface{}) (val []interface{})
- func (m *Map) GetToString(key string, def ...string) (val string)
- func (m *Map) GetToTime(key string, def ...time.Time) (val time.Time)
- func (m *Map) GetToUint(key string, def ...uint) (val uint)
- func (m *Map) GetToUint16(key string, def ...uint16) (val uint16)
- func (m *Map) GetToUint32(key string, def ...uint32) (val uint32)
- func (m *Map) GetToUint64(key string, def ...uint64) (val uint64)
- func (m *Map) GetToUint8(key string, def ...uint8) (val uint8)
- func (m Map) IsEmpty() bool
- func (m *Map) Set(key string, value interface{}) error
- type Maps
- type SliceType
- type StruBuilder
- func (b *StruBuilder) AddField(name string, fieldType interface{}, tag ...string) *StruBuilder
- func (b *StruBuilder) Copy(v *StruBuilder) *StruBuilder
- func (b *StruBuilder) GetField(name string) *StruField
- func (b *StruBuilder) HasField(name string) bool
- func (b *StruBuilder) Interface() interface{}
- func (b *StruBuilder) Merge(values ...interface{}) *StruBuilder
- func (b *StruBuilder) RemoveField(name string) *StruBuilder
- func (b *StruBuilder) Type() reflect.Type
- func (b *StruBuilder) Value() reflect.Value
- type StruField
- type Type
- func (t Type) Bool() bool
- func (t Type) Bytes() []byte
- func (t Type) Exists() bool
- func (t Type) Float32() float32
- func (t Type) Float64() float64
- func (t Type) Get(path string) Type
- func (t Type) Int() int
- func (t Type) Int16() int16
- func (t Type) Int32() int32
- func (t Type) Int64() int64
- func (t Type) Int8() int8
- func (t Type) Map() Map
- func (t Type) MapString() map[string]interface{}
- func (t Type) Slice() SliceType
- func (t Type) SliceValue() []interface{}
- func (t Type) String() string
- func (t Type) Time(format ...string) (time.Time, error)
- func (t Type) Uint() uint
- func (t Type) Uint16() uint16
- func (t Type) Uint32() uint32
- func (t Type) Uint64() uint64
- func (t Type) Uint8() uint8
- func (t Type) Value() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyToDecimal ¶ added in v1.1.11
AnyToDecimal Convert arbitrary decimal values to decimal
func DecimalToAny ¶ added in v1.1.11
DecimalToAny Convert decimal to arbitrary decimal values
func MapKeyExists ¶
func MapKeyExists(key interface{}, m map[interface{}]interface{}) bool
MapKeyExists Whether the dictionary key exists
func SliceStrToIface ¶ added in v1.3.0
func SliceStrToIface(slice []string) []interface{}
SliceStrToIface []string to []interface{}
func ToMapString ¶ added in v0.0.19
ToMapString ToMapString
func ToMapStringDeep ¶ added in v0.0.19
func ToSliceMapString ¶ added in v0.0.19
func ToSliceMapString(value interface{}) []map[string]interface{}
ToSliceMapString to SliceMapString
Types ¶
type Map ¶ added in v1.3.7
type Map map[string]interface{}
func (*Map) GetToBytes ¶ added in v1.4.3
func (*Map) GetToFloat32 ¶ added in v1.4.3
func (*Map) GetToFloat64 ¶ added in v1.4.3
func (*Map) GetToInt16 ¶ added in v1.4.3
func (*Map) GetToInt32 ¶ added in v1.4.3
func (*Map) GetToInt64 ¶ added in v1.4.3
func (*Map) GetToSlice ¶ added in v1.4.3
func (*Map) GetToSliceValue ¶ added in v1.4.3
func (*Map) GetToString ¶ added in v1.4.3
func (*Map) GetToUint16 ¶ added in v1.4.3
func (*Map) GetToUint32 ¶ added in v1.4.3
func (*Map) GetToUint64 ¶ added in v1.4.3
func (*Map) GetToUint8 ¶ added in v1.4.3
type StruBuilder ¶ added in v1.3.3
type StruBuilder struct {
// contains filtered or unexported fields
}
func NewMapStruct ¶ added in v1.3.1
func NewMapStruct(key interface{}) *StruBuilder
func NewSliceStruct ¶ added in v1.3.3
func NewSliceStruct() *StruBuilder
func NewStruct ¶ added in v1.3.1
func NewStruct() *StruBuilder
func (*StruBuilder) AddField ¶ added in v1.3.3
func (b *StruBuilder) AddField(name string, fieldType interface{}, tag ...string) *StruBuilder
func (*StruBuilder) Copy ¶ added in v1.3.3
func (b *StruBuilder) Copy(v *StruBuilder) *StruBuilder
func (*StruBuilder) GetField ¶ added in v1.3.3
func (b *StruBuilder) GetField(name string) *StruField
func (*StruBuilder) HasField ¶ added in v1.3.3
func (b *StruBuilder) HasField(name string) bool
func (*StruBuilder) Interface ¶ added in v1.3.3
func (b *StruBuilder) Interface() interface{}
func (*StruBuilder) Merge ¶ added in v1.3.3
func (b *StruBuilder) Merge(values ...interface{}) *StruBuilder
func (*StruBuilder) RemoveField ¶ added in v1.3.3
func (b *StruBuilder) RemoveField(name string) *StruBuilder
func (*StruBuilder) Type ¶ added in v1.3.3
func (b *StruBuilder) Type() reflect.Type
func (*StruBuilder) Value ¶ added in v1.3.3
func (b *StruBuilder) Value() reflect.Value
type StruField ¶ added in v1.3.3
type StruField struct {
// contains filtered or unexported fields
}
type Type ¶ added in v1.3.6
type Type struct {
// contains filtered or unexported fields
}
func (Type) SliceValue ¶ added in v1.4.3
func (t Type) SliceValue() []interface{}
Click to show internal directories.
Click to hide internal directories.