Documentation ¶
Index ¶
- func GetBool(i interface{}) (bool, bool)
- func GetComplex(i interface{}) (complex128, bool)
- func GetFloat(i interface{}) (float64, bool)
- func GetInt(i interface{}) (int64, bool)
- func GetString(i interface{}) (string, bool)
- func GetUint(i interface{}) (uint64, bool)
- func GetUnexportedField(field reflect.Value) interface{}
- func IsEmptyValue(i interface{}) bool
- func SetUnexportedField(field reflect.Value, value interface{})
- type Smpflag
- type Smplen
- type Smpval
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetComplex ¶ added in v1.4.2
func GetComplex(i interface{}) (complex128, bool)
GetComplex returns the complex128 value from complex64, complex128 interface.
func GetInt ¶ added in v1.3.3
GetInt returns the int64 value from int, int8, int32, int64 interface.
func GetUint ¶ added in v1.3.3
GetUint returns the uint64 value from uint, uint8, uint16, uint32, uint64, uintptr interface.
func GetUnexportedField ¶ added in v1.4.1
GetUnexportedField gets the unexported struct field value. Example:
GetUnexportedField(reflect.ValueOf(app).Elem().FieldByName("noMethod")).(gin.HandlersChain)
func IsEmptyValue ¶ added in v1.5.0
func IsEmptyValue(i interface{}) bool
IsEmptyValue checks if a value is an empty value, panics when using unsupported type. Only supports:
int, intX, uint, uintX, uintptr, floatX, complexX, bool, string, slice, array, map, interface, pointer.
func SetUnexportedField ¶ added in v1.4.1
SetUnexportedField sets value to unexported struct field. Example:
SetUnexportedField(reflect.ValueOf(c).Elem().FieldByName("fullPath"), fullPath)
Types ¶
type Smpflag ¶ added in v1.5.0
type Smpflag int8
Smpflag represents Smpval and Smplen flags. Includes: Int, Uint, Float, Complex, Bool, String.
type Smplen ¶ added in v1.5.0
type Smplen struct {
// contains filtered or unexported fields
}
Smplen represents the length for some simple types and collection types. Includes:
- Int (value): int, int8 (byte), int16, int32 (rune), int64.
- Int (length): string, slice, map, array.
- Uint (value): uint, uint8, uint16, uint32, uint64, uintptr.
- Float (value): float32, float64.
- Complex (value): complex64, complex128.
- Bool (value): bool
func SmplenOf ¶ added in v1.5.0
func SmplenOf(i interface{}) *Smplen
SmplenOf gets the Smplen of given value, panics when using unsupported type. Only supports:
int, intX, uint, uintX, uintptr, floatX, complexX, bool, string, slice, array, map.
func (*Smplen) Complex ¶ added in v1.5.0
func (i *Smplen) Complex() complex128
Complex returns the complex128 value of Smplen.
type Smpval ¶ added in v1.5.0
type Smpval struct {
// contains filtered or unexported fields
}
Smpval represents the actual value for some simple types. Includes:
- Int: int, int8 (byte), int16, int32 (rune), int64.
- Uint: uint, uint8, uint16, uint32, uint64, uintptr.
- Float: float32, float64.
- Complex: complex64, complex128.
- Bool: bool.
- String: string.
func SmpvalOf ¶ added in v1.5.0
func SmpvalOf(i interface{}) *Smpval
SmpvalOf gets the Smpval from the given value, panics when using unsupported type. Only supports:
int, intX, uint, uintX, uintptr, floatX, complexX, bool, string.
func (*Smpval) Complex ¶ added in v1.5.0
func (i *Smpval) Complex() complex128
Complex returns the complex128 value of Smpval.