Documentation ¶
Index ¶
- func BytesToString(buf []byte) string
- func StringToBytes(s string) []byte
- func StringToInt32Slice(s, sep string) []int32
- func StringToInt64Slice(s, sep string) []int64
- func StringToIntSlice(s, sep string) []int
- func StringToTime(s string) (t time.Time, e error)
- func StringToType(s string, p reflect.Type) interface{}
- func ToBool(i interface{}, d ...bool) bool
- func ToDuration(i interface{}, d ...time.Duration) time.Duration
- func ToFloat32(i interface{}, d ...float32) float32
- func ToFloat64(i interface{}, d ...float64) float64
- func ToInt(i interface{}, d ...int) int
- func ToInt16(i interface{}, d ...int16) int16
- func ToInt32(i interface{}, d ...int32) int32
- func ToInt32Slice(i interface{}, d ...[]int32) (r []int32)
- func ToInt64(i interface{}, d ...int64) int64
- func ToInt64Slice(i interface{}, d ...[]int64) (r []int64)
- func ToInt8(i interface{}, d ...int8) int8
- func ToString(i interface{}) string
- func ToTime(i interface{}, d ...time.Time) time.Time
- func ToUint(i interface{}, d ...uint) uint
- func ToUint16(i interface{}, d ...uint16) uint16
- func ToUint32(i interface{}, d ...uint32) uint32
- func ToUint64(i interface{}, d ...uint64) uint64
- func ToUint8(i interface{}, d ...uint8) uint8
- func TryToBool(i interface{}) (b bool, err error)
- func TryToDuration(i interface{}) (d time.Duration, err error)
- func TryToFloat32(i interface{}) (r float32, err error)
- func TryToFloat64(i interface{}) (r float64, err error)
- func TryToInt(i interface{}) (r int, err error)
- func TryToInt16(i interface{}) (r int16, err error)
- func TryToInt32(i interface{}) (r int32, err error)
- func TryToInt32Slice(i interface{}) (r []int32, err error)
- func TryToInt64(i interface{}) (r int64, err error)
- func TryToInt64Slice(i interface{}) (r []int64, err error)
- func TryToInt8(i interface{}) (r int8, err error)
- func TryToSlice(i interface{}, t reflect.Type) (interface{}, error)
- func TryToSliceValue(i interface{}, t reflect.Type) (slice reflect.Value, err error)
- func TryToTime(i interface{}) (t time.Time, err error)
- func TryToUint(i interface{}) (r uint, err error)
- func TryToUint16(i interface{}) (r uint16, err error)
- func TryToUint32(i interface{}) (r uint32, err error)
- func TryToUint64(i interface{}) (r uint64, err error)
- func TryToUint8(i interface{}) (r uint8, err error)
- func TryToValue(i interface{}, t reflect.Type) (v reflect.Value, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts []byte to string with zero-copy
func StringToBytes ¶
StringToBytes converts string to []byte with zero-copy
func StringToInt32Slice ¶
StringToInt32Slice converts string to []int32
func StringToInt64Slice ¶
StringToInt64Slice converts string to []int64
func StringToIntSlice ¶
StringToIntSlice converts string to []int
func StringToTime ¶
StringToTime casts an empty interface to a time.Time.
func ToInt32Slice ¶
ToInt32Slice casts an empty interface to []int32.
func ToInt64Slice ¶
ToInt64Slice casts an empty interface to []int64.
func TryToDuration ¶
TryToDuration casts an empty interface to time.Duration.
func TryToFloat32 ¶
TryToFloat32 casts an empty interface to a float32.
func TryToFloat64 ¶
TryToFloat64 casts an empty interface to a float64.
func TryToInt16 ¶
TryToInt16 casts an empty interface to an int16.
func TryToInt32 ¶
TryToInt32 casts an empty interface to an int32.
func TryToInt32Slice ¶
TryToInt32Slice casts an empty interface to []int32.
func TryToInt64 ¶
TryToInt64 casts an empty interface to an int64.
func TryToInt64Slice ¶
TryToInt64Slice casts an empty interface to []int64.
func TryToSlice ¶
func TryToSliceValue ¶
TryToSliceValue cast interface value to a slice. Argument t is element type of slice.
func TryToUint16 ¶
TryToUint16 casts an empty interface to a uint16.
func TryToUint32 ¶
TryToUint32 casts an empty interface to a uint32.
func TryToUint64 ¶
TryToUint64 casts an empty interface to a uint64.
func TryToUint8 ¶
TryToUint8 casts an empty interface to an uint8.
Types ¶
This section is empty.