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 Slice(value interface{}) []interface{}deprecated
- func SliceStrToIface(slice []string) []interface{}
- func ToBool(i interface{}) bool
- func ToByte(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 ToSlice(value interface{}) (s []interface{})
- func ToSliceMapString(value interface{}) []map[string]interface{}
- func ToString(i interface{}) string
- func ToTime(i interface{}) (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
- 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) Exists() bool
- func (t Type) Float32() float32
- func (t Type) Float64() float64
- 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) MapString() map[string]interface{}
- func (t Type) Slice() []interface{}
- func (t Type) String() string
- func (t Type) Time() (time.Time, error)
- func (t Type) ToByte() []byte
- 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 Slice
deprecated
added in
v0.0.19
func Slice(value interface{}) []interface{}
Deprecated: please use ToSlice
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 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
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.