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 SliceStrToAny(slice []string) []interface{}
- func To(input, out interface{}, opt ...func(*Conver)) error
- 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 ToString(i interface{}) string
- func ToStruct(v interface{}, outVal interface{}) error
- 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
- func ValueConv(input interface{}, out reflect.Value, opt ...func(*Conver)) error
- type Conver
- type Map
- type Maps
- type SliceType
- func (s SliceType) First() Type
- func (s SliceType) Index(i int) Type
- func (s SliceType) Int() []int
- func (s SliceType) Last() Type
- func (s SliceType) Len() int
- func (s SliceType) Maps() Maps
- func (s SliceType) MarshalJSON() ([]byte, error)
- func (s SliceType) String() []string
- func (s SliceType) Value() []interface{}
- type StruBuilder
- func (b *StruBuilder) AddField(name string, fieldType interface{}, tag ...string) *StruBuilder
- func (b *StruBuilder) Copy(v *StruBuilder) *StruBuilder
- func (b *StruBuilder) FieldNames() []string
- 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{}) error
- func (b *StruBuilder) RemoveField(name string) *StruBuilder
- func (b *StruBuilder) String() string
- func (b *StruBuilder) Type() reflect.Type
- func (b *StruBuilder) Value() reflect.Value
- type StruField
- type Type
- func (t Type) Bool(def ...bool) bool
- func (t Type) Bytes(def ...[]byte) []byte
- func (t Type) Exists() bool
- func (t Type) Float32(def ...float32) float32
- func (t Type) Float64(def ...float64) float64
- func (t Type) Get(path string) Type
- func (t Type) Int(def ...int) int
- func (t Type) Int16(def ...int16) int16
- func (t Type) Int32(def ...int32) int32
- func (t Type) Int64(def ...int64) int64
- func (t Type) Int8(def ...int8) int8
- func (t Type) Map() Map
- func (t Type) Maps() Maps
- func (t Type) Slice(noConv ...bool) SliceType
- func (t Type) SliceInt(noConv ...bool) []int
- func (t Type) SliceString(noConv ...bool) []string
- func (t Type) SliceValue(noConv ...bool) []interface{}
- func (t Type) String(def ...string) string
- func (t Type) Time(format ...string) (time.Time, error)
- func (t Type) Uint(def ...uint) uint
- func (t Type) Uint16(def ...uint16) uint16
- func (t Type) Uint32(def ...uint32) uint32
- func (t Type) Uint64(def ...uint64) uint64
- func (t Type) Uint8(def ...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 SliceStrToAny ¶ added in v1.6.4
func SliceStrToAny(slice []string) []interface{}
SliceStrToAny []string to []interface{}
func ToStruct ¶ added in v1.6.4
func ToStruct(v interface{}, outVal interface{}) error
ToStruct map or struct to struct
Types ¶
type SliceType ¶ added in v1.4.3
type SliceType []Type
func (SliceType) MarshalJSON ¶ added in v1.6.4
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 NewStructFromValue ¶ added in v1.7.15
func NewStructFromValue(v interface{}) (*StruBuilder, error)
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{}) error
func (*StruBuilder) RemoveField ¶ added in v1.3.3
func (b *StruBuilder) RemoveField(name string) *StruBuilder
func (*StruBuilder) String ¶ added in v1.7.15
func (b *StruBuilder) String() string
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) SliceString ¶ added in v1.6.3
func (Type) SliceValue ¶ added in v1.4.3
Click to show internal directories.
Click to hide internal directories.