Documentation ¶
Index ¶
- func AppendUnion(storage interface{}, field interface{}) error
- func AsBool(v interface{}) bool
- func AsByte(v interface{}) byte
- func AsByteSlice(v interface{}) []byte
- func AsFloat32(v interface{}) float32
- func AsFloat64(v interface{}) float64
- func AsInt(v interface{}) int
- func AsInt16(v interface{}) int16
- func AsInt32(v interface{}) int32
- func AsInt64(v interface{}) int64
- func AsInt8(v interface{}) int8
- func AsRune(v interface{}) rune
- func AsString(v interface{}) string
- func AsUInt(v interface{}) uint
- func AsUInt16(v interface{}) uint16
- func AsUInt32(v interface{}) uint32
- func AsUInt64(v interface{}) uint64
- func AsUInt8(v interface{}) uint8
- func AsUintPtr(v interface{}) uintptr
- func BuildUnion(storage interface{}, fields ...interface{}) error
- func ToByteSlice(v interface{}) []byte
- func ToString(v interface{}) string
- func Union(struc interface{})
- type Caster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsBool ¶
func AsBool(v interface{}) bool
AsBool - returns bool representation of passed value NOTE: variable can fit data up to its sizeof
func AsByte ¶
func AsByte(v interface{}) byte
AsByte - returns byte representation of passed value NOTE: variable can fit data up to its sizeof
func AsByteSlice ¶
func AsByteSlice(v interface{}) []byte
AsByteSlice - returns []byte representation of passed value do not leak result to heap if you want to stay safe
func AsFloat32 ¶
func AsFloat32(v interface{}) float32
AsFloat32 - returns float32 representation of passed value NOTE: variable can fit data up to its sizeof
func AsFloat64 ¶
func AsFloat64(v interface{}) float64
AsFloat64 - returns float64 representation of passed value NOTE: variable can fit data up to its sizeof
func AsInt ¶
func AsInt(v interface{}) int
AsInt - returns int representation of passed value NOTE: variable can fit data up to its sizeof
func AsInt16 ¶
func AsInt16(v interface{}) int16
AsInt16 - returns int16 representation of passed value NOTE: variable can fit data up to its sizeof
func AsInt32 ¶
func AsInt32(v interface{}) int32
AsInt32 - returns int32 representation of passed value NOTE: variable can fit data up to its sizeof
func AsInt64 ¶
func AsInt64(v interface{}) int64
AsInt64 - returns int64 representation of passed value NOTE: variable can fit data up to its sizeof
func AsInt8 ¶
func AsInt8(v interface{}) int8
AsInt8 - returns int8 representation of passed value NOTE: variable can fit data up to its sizeof
func AsRune ¶
func AsRune(v interface{}) rune
AsRune - returns rune representation of passed value NOTE: variable can fit data up to its sizeof
func AsString ¶
func AsString(v interface{}) string
AsString - returns string representation of passed value do not leak result to heap if you want to stay safe
func AsUInt ¶
func AsUInt(v interface{}) uint
AsUInt - returns uint representation of passed value NOTE: variable can fit data up to its sizeof
func AsUInt16 ¶
func AsUInt16(v interface{}) uint16
AsUInt16 - returns uint16 representation of passed value NOTE: variable can fit data up to its sizeof
func AsUInt32 ¶
func AsUInt32(v interface{}) uint32
AsUInt32 - returns uint32 representation of passed value NOTE: variable can fit data up to its sizeof
func AsUInt64 ¶
func AsUInt64(v interface{}) uint64
AsUInt64 - returns uint64 representation of passed value NOTE: variable can fit data up to its sizeof
func AsUInt8 ¶
func AsUInt8(v interface{}) uint8
AsUInt8 - returns uint8 representation of passed value NOTE: variable can fit data up to its sizeof
func AsUintPtr ¶
func AsUintPtr(v interface{}) uintptr
AsUintPtr - returns uintptr representation of passed value NOTE: variable can fit data up to its sizeof
func ToByteSlice ¶
func ToByteSlice(v interface{}) []byte
ToByteSlice - Accepts only slices, arrays, strings and pointers to primitives. Primitives converts to []byte with len up to its sizeof. Returns nil if fails
NOTE: it permanently transmutates original value if its element size is larger than destination one. Use AsByteSlice instead or after this function call. Also do not leak result to heap if you want to stay safe.
func ToString ¶
func ToString(v interface{}) string
ToString - Accepts only slices, arrays, strings and pointers to primitives. Primitives converts to string with len up to its sizeof. Returns "" if fails
NOTE: it permanently transmutates original value if its element size is larger than destination one. Use AsString instead or after this function call. Also do not leak result to heap if you want to stay safe.
Types ¶
type Caster ¶
type Caster struct {
// contains filtered or unexported fields
}
Caster -
func (*Caster) AsByteSlice ¶
AsByteSlice -