Documentation ¶
Index ¶
- Constants
- Variables
- func StringToDate(s string) time.Time
- func StringToDateE(s string) (time.Time, error)
- func ToBool(i interface{}) bool
- func ToBoolE(i interface{}) (bool, error)
- func ToBoolSlice(i interface{}) []bool
- func ToBoolSliceE(i interface{}) ([]bool, error)
- func ToDuration(i interface{}) time.Duration
- func ToDurationE(i interface{}) (d time.Duration, err error)
- func ToDurationSlice(i interface{}) []time.Duration
- func ToDurationSliceE(i interface{}) ([]time.Duration, error)
- func ToFloat32(i interface{}) float32
- func ToFloat32E(i interface{}) (float32, error)
- func ToFloat64(i interface{}) float64
- func ToFloat64E(i interface{}) (float64, error)
- func ToInt(i interface{}) int
- func ToInt16(i interface{}) int16
- func ToInt16E(i interface{}) (int16, error)
- func ToInt32(i interface{}) int32
- func ToInt32E(i interface{}) (int32, error)
- func ToInt64(i interface{}) int64
- func ToInt64E(i interface{}) (int64, error)
- func ToInt64Slice(i interface{}) []int64
- func ToInt64SliceE(i interface{}) ([]int64, error)
- func ToInt8(i interface{}) int8
- func ToInt8E(i interface{}) (int8, error)
- func ToIntE(i interface{}) (int, error)
- func ToIntSlice(i interface{}) []int
- func ToIntSliceE(i interface{}) ([]int, error)
- func ToSlice(i interface{}) []interface{}
- func ToSliceE(i interface{}) ([]interface{}, error)
- func ToString(i interface{}) string
- func ToStringE(i interface{}) (string, error)
- func ToStringMap(i interface{}) map[string]interface{}
- func ToStringMapBool(i interface{}) map[string]bool
- func ToStringMapBoolE(i interface{}) (map[string]bool, error)
- func ToStringMapE(i interface{}) (map[string]interface{}, error)
- func ToStringMapString(i interface{}) map[string]string
- func ToStringMapStringE(i interface{}) (map[string]string, error)
- func ToStringMapStringSlice(i interface{}) map[string][]string
- func ToStringMapStringSliceE(i interface{}) (map[string][]string, error)
- func ToStringSlice(i interface{}) []string
- func ToStringSliceE(i interface{}) ([]string, error)
- func ToTime(i interface{}) time.Time
- func ToTimeE(i interface{}) (time.Time, error)
- func ToUint(i interface{}) uint
- func ToUint16(i interface{}) uint16
- func ToUint16E(i interface{}) (uint16, error)
- func ToUint32(i interface{}) uint32
- func ToUint32E(i interface{}) (uint32, error)
- func ToUint64(i interface{}) uint64
- func ToUint64E(i interface{}) (uint64, error)
- func ToUint64Slice(i interface{}) []uint64
- func ToUint64SliceE(i interface{}) ([]uint64, error)
- func ToUint8(i interface{}) uint8
- func ToUint8E(i interface{}) (uint8, error)
- func ToUintE(i interface{}) (uint, error)
Constants ¶
const ( // ISO8601Date defines the ISO-8601 date format. ISO8601Date = "2006-01-02" // ISO8601DateTime1 defines the ISO-8601 date/time format without a // timezone offset. ISO8601DateTime1 = "2006-01-02 15:04:05" // ISO8601DateTime2 defines the ISO-8601 date/time format without a // timezone offset. ISO8601DateTime2 = "2006-01-02T15:04:05" // ISO8601DateTimeOffset1 defines the ISO-8601 date/time format with a // timezone offset. ISO8601DateTimeOffset1 = "2006-01-02 15:04:05Z07:00" // ISO8601DateTimeOffset2 defines the ISO-8601 date/time format with a // timezone offset. ISO8601DateTimeOffset2 = "2006-01-02 15:04:05 -07:00" // ISO8601DateTimeOffset3 defines the ISO-8601 date/time format with a // timezone offset. ISO8601DateTimeOffset3 = "2006-01-02 15:04:05 -0700" // TimeString defines the Time.String() date/time format. TimeString = "2006-01-02 15:04:05.999999999 -0700 MST" )
Variables ¶
var ErrUintBelowZero = errors.New("cannot cast negative value as uint")
ErrUintBelowZero defines the error returned when attempting to cast a negative value as a uint.
Functions ¶
func StringToDate ¶
StringToDate attempts to parse a string into a time.Time type using a predefined list of formats. If no suitable format is found, an error is returned. Any errors are discarded
func StringToDateE ¶
StringToDateE attempts to parse a string into a time.Time type using a predefined list of formats. If no suitable format is found, an error is returned.
func ToBool ¶
func ToBool(i interface{}) bool
ToBool casts an interface to a bool type, discarding any errors.
func ToBoolSlice ¶
func ToBoolSlice(i interface{}) []bool
ToBoolSlice casts an interface to a []bool type, discarding any errors.
func ToBoolSliceE ¶
ToBoolSliceE casts an interface to a []bool type.
func ToDuration ¶
ToDuration casts an interface to a time.Duration type, discarding any errors.
func ToDurationE ¶
ToDurationE casts an interface to a time.Duration type.
func ToDurationSlice ¶
ToDurationSlice casts an interface to a []time.Duration type, discarding any errors.
func ToDurationSliceE ¶
ToDurationSliceE casts an interface to a []time.Duration type.
func ToFloat32 ¶
func ToFloat32(i interface{}) float32
ToFloat32 casts an interface to a float32 type, discarding any errors.
func ToFloat32E ¶
ToFloat32E casts an interface to a float32 type.
func ToFloat64 ¶
func ToFloat64(i interface{}) float64
ToFloat64 casts an interface to a float64 type, discarding any errors.
func ToFloat64E ¶
ToFloat64E casts an interface to a float64 type.
func ToInt ¶
func ToInt(i interface{}) int
ToInt casts an interface to an int type, discarding any errors.
func ToInt16 ¶
func ToInt16(i interface{}) int16
ToInt16 casts an interface to an int16 type, discarding any errors.
func ToInt32 ¶
func ToInt32(i interface{}) int32
ToInt32 casts an interface to an int32 type, discarding any errors.
func ToInt64 ¶
func ToInt64(i interface{}) int64
ToInt64 casts an interface to an int64 type, discarding any errors.
func ToInt64Slice ¶ added in v1.0.1
func ToInt64Slice(i interface{}) []int64
ToInt64Slice casts an interface to a []int type, discarding any errors.
func ToInt64SliceE ¶ added in v1.0.1
ToInt64SliceE casts an interface to a []int type.
func ToInt8 ¶
func ToInt8(i interface{}) int8
ToInt8 casts an interface to an int8 type, discarding any errors.
func ToIntSlice ¶
func ToIntSlice(i interface{}) []int
ToIntSlice casts an interface to a []int type, discarding any errors.
func ToIntSliceE ¶
ToIntSliceE casts an interface to a []int type.
func ToSlice ¶
func ToSlice(i interface{}) []interface{}
ToSlice casts an interface to a []interface{} type, discarding any errors.
func ToSliceE ¶
func ToSliceE(i interface{}) ([]interface{}, error)
ToSliceE casts an interface to a []interface{} type.
func ToString ¶
func ToString(i interface{}) string
ToString casts an interface to a string type, discarding any errors.
func ToStringMap ¶
func ToStringMap(i interface{}) map[string]interface{}
ToStringMap casts an interface to a map[string]interface{} type, discarding any errors.
func ToStringMapBool ¶
ToStringMapBool casts an interface to a map[string]bool type, discarding any errors.
func ToStringMapBoolE ¶
ToStringMapBoolE casts an interface to a map[string]bool type.
func ToStringMapE ¶
ToStringMapE casts an interface to a map[string]interface{} type.
func ToStringMapString ¶
ToStringMapString casts an interface to a map[string]string type, discarding any errors.
func ToStringMapStringE ¶
ToStringMapStringE casts an interface to a map[string]string type.
func ToStringMapStringSlice ¶
ToStringMapStringSlice casts an interface to a map[string][]string type, discarding any errors.
func ToStringMapStringSliceE ¶
ToStringMapStringSliceE casts an interface to a map[string][]string type.
func ToStringSlice ¶
func ToStringSlice(i interface{}) []string
ToStringSlice casts an interface to a []string type, discarding any errors.
func ToStringSliceE ¶
ToStringSliceE casts an interface to a []string type.
func ToUint ¶
func ToUint(i interface{}) uint
ToUint casts an interface to a uint type, discarding any errors.
func ToUint16 ¶
func ToUint16(i interface{}) uint16
ToUint16 casts an interface to a uint16 type, discarding any errors.
func ToUint32 ¶
func ToUint32(i interface{}) uint32
ToUint32 casts an interface to a uint32 type, discarding any errors.
func ToUint64 ¶
func ToUint64(i interface{}) uint64
ToUint64 casts an interface to a uint64 type, discarding any errors.
func ToUint64Slice ¶ added in v1.0.2
func ToUint64Slice(i interface{}) []uint64
ToUint64Slice casts an interface to a []int type, discarding any errors.
func ToUint64SliceE ¶ added in v1.0.2
ToUint64SliceE casts an interface to a []int type.
func ToUint8 ¶
func ToUint8(i interface{}) uint8
ToUint8 casts an interface to a uint type, discarding any errors.
Types ¶
This section is empty.