Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertToBool(vv interface{}) (bool, error)
- func ConvertToComplex64(vv interface{}) (complex64, error)
- func ConvertToComplex128(vv interface{}) (complex128, error)
- func ConvertToFloat32(vv interface{}) (float32, error)
- func ConvertToFloat64(vv interface{}) (float64, error)
- func ConvertToInt(vv interface{}) (int, error)
- func ConvertToInt8(vv interface{}) (int8, error)
- func ConvertToInt16(vv interface{}) (int16, error)
- func ConvertToInt32(vv interface{}) (int32, error)
- func ConvertToInt64(vv interface{}) (int64, error)
- func ConvertToString(vv interface{}) (string, error)
- func ConvertToType(v interface{}, t Type) (interface{}, error)
- func ConvertToUint(vv interface{}) (uint, error)
- func ConvertToUint8(vv interface{}) (uint8, error)
- func ConvertToUint16(vv interface{}) (uint16, error)
- func ConvertToUint32(vv interface{}) (uint32, error)
- func ConvertToUint64(vv interface{}) (uint64, error)
- func Indirect(v interface{}) interface{}
- type ErrCanNotAssertType
- type ErrCanNotConvertType
- type ErrCanNotParseType
- type ErrUnknownType
- type ErrWrongArgumentsQuantity
- type ErrWrongKind
- type Kind
- type Type
- type Value
Constants ¶
View Source
const ( Invalid = reflect.Invalid Bool = reflect.Bool Int = reflect.Int Int8 = reflect.Int8 Int16 = reflect.Int16 Int32 = reflect.Int32 Int64 = reflect.Int64 Uint = reflect.Uint Uint8 = reflect.Uint8 Uint16 = reflect.Uint16 Uint32 = reflect.Uint32 Uint64 = reflect.Uint64 Uintptr = reflect.Uintptr Float32 = reflect.Float32 Float64 = reflect.Float64 Complex64 = reflect.Complex64 Complex128 = reflect.Complex128 Array = reflect.Array Chan = reflect.Chan Func = reflect.Func Interface = reflect.Interface Map = reflect.Map Ptr = reflect.Ptr Slice = reflect.Slice String = reflect.String Struct = reflect.Struct UnsafePointer = reflect.UnsafePointer )
Variables ¶
View Source
var ( Types = []Type{ TypeBool, TypeInt, TypeInt8, TypeInt16, TypeInt32, TypeInt64, TypeUint, TypeUint8, TypeUint16, TypeUint32, TypeUint64, TypeFloat32, TypeFloat64, TypeComplex64, TypeComplex128, TypeUintptr, TypeString, } TypeInvalid = Type(nil) 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)) TypeComplex64 = reflect.TypeOf(complex64(0)) TypeComplex128 = reflect.TypeOf(complex128(0)) TypeUintptr = reflect.TypeOf(uintptr(0)) TypeString = reflect.TypeOf(string("")) )
View Source
var (
TypeOf = reflect.TypeOf
)
View Source
var (
ValueOf = reflect.ValueOf
)
Functions ¶
func ConvertToBool ¶
func ConvertToComplex64 ¶
func ConvertToComplex128 ¶
func ConvertToComplex128(vv interface{}) (complex128, error)
func ConvertToFloat32 ¶
func ConvertToFloat64 ¶
func ConvertToInt ¶
func ConvertToInt8 ¶
func ConvertToInt16 ¶
func ConvertToInt32 ¶
func ConvertToInt64 ¶
func ConvertToString ¶
func ConvertToType ¶
func ConvertToUint ¶
func ConvertToUint8 ¶
func ConvertToUint16 ¶
func ConvertToUint32 ¶
func ConvertToUint64 ¶
Types ¶
type ErrCanNotAssertType ¶
type ErrCanNotAssertType struct {
// contains filtered or unexported fields
}
func NewErrCanNotAssertType ¶
func NewErrCanNotAssertType(value interface{}, to Type, reason ...string) ErrCanNotAssertType
func (ErrCanNotAssertType) Error ¶
func (e ErrCanNotAssertType) Error() string
type ErrCanNotConvertType ¶
type ErrCanNotConvertType struct {
// contains filtered or unexported fields
}
func NewErrCanNotConvertType ¶
func NewErrCanNotConvertType(value interface{}, from Type, to Type, reason ...string) ErrCanNotConvertType
func (ErrCanNotConvertType) Error ¶
func (e ErrCanNotConvertType) Error() string
type ErrCanNotParseType ¶
type ErrCanNotParseType struct {
// contains filtered or unexported fields
}
func NewErrCanNotParseType ¶
func NewErrCanNotParseType(t string, reason string) ErrCanNotParseType
func (ErrCanNotParseType) Error ¶
func (e ErrCanNotParseType) Error() string
type ErrUnknownType ¶
type ErrUnknownType struct {
Value interface{}
}
func NewErrUnknownType ¶
func NewErrUnknownType(v interface{}) *ErrUnknownType
func (*ErrUnknownType) Error ¶
func (e *ErrUnknownType) Error() string
type ErrWrongArgumentsQuantity ¶
func NewErrWrongArgumentsQuantity ¶
func NewErrWrongArgumentsQuantity(want int, got int) *ErrWrongArgumentsQuantity
func (*ErrWrongArgumentsQuantity) Error ¶
func (e *ErrWrongArgumentsQuantity) Error() string
type ErrWrongKind ¶
func NewErrWrongKind ¶
func NewErrWrongKind(want Kind, got Kind) *ErrWrongKind
func (*ErrWrongKind) Error ¶
func (e *ErrWrongKind) Error() string
type Type ¶
func IndirectType ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.