Documentation ¶
Index ¶
- Constants
- Variables
- func Atok(str string, k reflect.Kind) (output reflect.Value, err error)
- func Atov(str string, typ reflect.Type) (output reflect.Value, err error)
- func BToi(b bool) int
- func CanCompareKind(a, b reflect.Kind) bool
- func CanCompareValue(a, b reflect.Value) bool
- func CanPointer(kind reflect.Kind) bool
- func CanTypeElem(kind reflect.Kind) bool
- func CanValueElem(kind reflect.Kind) bool
- func Compare(a interface{}, b interface{}) int
- func Equal(a interface{}, b interface{}) bool
- func FieldByName(v reflect.Value, name string) (field reflect.Value, ok bool)
- func FieldByNameFold(v reflect.Value, name string) (field reflect.Value, ok bool)
- func Fields(typ reflect.Type) []string
- func Greater(a interface{}, b interface{}) (result bool)
- func IsBool(kind reflect.Kind) bool
- func IsCollect(kind reflect.Kind) bool
- func IsFloat(kind reflect.Kind) bool
- func IsInt(kind reflect.Kind) bool
- func IsNumeric(kind reflect.Kind) bool
- func IsSimple(kind reflect.Kind) bool
- func IsString(kind reflect.Kind) bool
- func IsStruct(kind reflect.Kind) bool
- func IsUint(kind reflect.Kind) bool
- func Less(a interface{}, b interface{}) bool
- func MethodByName(v reflect.Value, name string) (m reflect.Value, ok bool)
- func MethodByNameFold(v reflect.Value, name string) (m reflect.Value, ok bool)
- func SetAddr(a reflect.Value, b reflect.Value)
- func ToBool(input reflect.Value) (output bool, err error)
- func ToFloat(input reflect.Value) (output float64, err error)
- func ToInt(input reflect.Value) (output int64, err error)
- func ToMap(input reflect.Value) map[string]reflect.Value
- func ToString(input reflect.Value) (output string, err error)
- func ToUint(input reflect.Value) (output uint64, err error)
- func Underlying(v reflect.Value) reflect.Value
- func UnderlyingKind(v reflect.Value) reflect.Kind
- func UnderlyingType(typ reflect.Type) reflect.Type
- type MethodInfo
- type TypeError
- type Value
- func (v Value) CanCompareTo(i reflect.Value) bool
- func (v Value) CanElem() bool
- func (v Value) CanPointer() bool
- func (v Value) Fields() []string
- func (v Value) Format() string
- func (v Value) FromStr_Todel(str string)
- func (v Value) IsBool() bool
- func (v Value) IsCollect() bool
- func (v Value) IsEmptyValue() bool
- func (v Value) IsFloat() bool
- func (v Value) IsInt() bool
- func (v Value) IsNumeric() bool
- func (v Value) IsSimple() bool
- func (v Value) IsString() bool
- func (v Value) IsStruct() bool
- func (v Value) IsUint() bool
- func (rv Value) Parse(s string)
- func (v Value) Set(x reflect.Value)
- func (v Value) String() string
- func (v Value) Underlying() reflect.Value
- func (v Value) UnderlyingKind() reflect.Kind
- func (v Value) UnderlyingType() reflect.Type
- func (v Value) Value() reflect.Value
Constants ¶
View Source
const ( MaxUint8 uint8 = 255 MaxUint16 uint16 = 65535 MaxUint32 uint32 = 4294967295 MaxUint64 uint64 = 18446744073709551615 MaxInt8 int8 = 127 MaxInt16 int16 = 32767 MaxInt32 int32 = 2147483647 MaxInt64 int64 = 9223372036854775807 MinInt8 int8 = -128 MinInt16 int16 = -32768 MinInt32 int32 = -2147483648 MinInt64 int64 = -9223372036854775808 )
Variables ¶
View Source
var ( TypeBool = reflect.TypeOf(false) TypeInt = reflect.TypeOf(int(0)) TypeInt8 = reflect.TypeOf(int8(0)) TypeInt16 = reflect.TypeOf(int16(0)) TypeInt32 = reflect.TypeOf(int32(0)) TypeInt64 = reflect.TypeOf(int64(0)) TypeUint = reflect.TypeOf(uint(0)) TypeUint8 = reflect.TypeOf(uint8(0)) TypeUint16 = reflect.TypeOf(uint16(0)) TypeUint32 = reflect.TypeOf(uint32(0)) TypeUint64 = reflect.TypeOf(uint64(0)) TypeFloat32 = reflect.TypeOf(float32(0)) TypeFloat64 = reflect.TypeOf(float64(0)) TypeString = reflect.TypeOf("") TypeByteSlice = reflect.TypeOf([]byte(nil)) )
Functions ¶
func Compare ¶
func Compare(a interface{}, b interface{}) int
compare a and b, return 0 (a==b), 1 (a > b), -1 (a<b)
func FieldByName ¶
get public field by name
func FieldByNameFold ¶
get public field by name ignore case
func Greater ¶
func Greater(a interface{}, b interface{}) (result bool)
a > b?, just compare simple data type
func MethodByName ¶
get public method by name
func MethodByNameFold ¶
get public method by name ignore case
func UnderlyingKind ¶
get kind of underlying value
Types ¶
type MethodInfo ¶
type MethodInfo struct { Method reflect.Method // Type Type reflect.Type // Value Func reflect.Value // NumIn is number of input paramter NumIn int // NumOut is number of output paramter NumOut int // Ins is input parameter type In []reflect.Type // Outs is output parameter type Out []reflect.Type }
func GetMethodInfo ¶
func GetMethodInfo(method reflect.Method) *MethodInfo
func GetMethodInfoByValue ¶
func GetMethodInfoByValue(fnValue reflect.Value) *MethodInfo
func (*MethodInfo) String ¶
func (m *MethodInfo) String() string
type TypeError ¶
type TypeError struct { Func string // the failing function Message string // the error message Inner interface{} // reference value }
go type error
Click to show internal directories.
Click to hide internal directories.