Documentation ¶
Index ¶
- Variables
- func Bool(v interface{}, def ...bool) bool
- func BoolE(val interface{}) (bool, error)
- func BoolP(v interface{}, def ...bool) *bool
- func ColumnsE(val interface{}, field interface{}) (sl []interface{}, err error)
- func Field(v interface{}, field interface{}, def ...interface{}) interface{}
- func FieldE(val interface{}, field interface{}) (interface{}, error)
- func Float32(v interface{}, def ...float32) float32
- func Float32E(val interface{}) (float32, error)
- func Float32P(v interface{}, def ...float32) *float32
- func Float64(v interface{}, def ...float64) float64
- func Float64E(val interface{}) (float64, error)
- func Float64P(v interface{}, def ...float64) *float64
- func Indirect(a interface{}) (val interface{}, rv reflect.Value)
- func Int(v interface{}, def ...int) int
- func Int16(v interface{}, def ...int16) int16
- func Int16E(val interface{}) (int16, error)
- func Int16P(v interface{}, def ...int16) *int16
- func Int32(v interface{}, def ...int32) int32
- func Int32E(val interface{}) (int32, error)
- func Int32P(v interface{}, def ...int32) *int32
- func Int64(v interface{}, def ...int64) int64
- func Int64E(val interface{}) (int64, error)
- func Int64P(v interface{}, def ...int64) *int64
- func Int8(v interface{}, def ...int8) int8
- func Int8E(val interface{}) (int8, error)
- func Int8P(v interface{}, def ...int8) *int8
- func IntE(val interface{}) (int, error)
- func IntMapE(val interface{}) (m map[int]interface{}, err error)
- func IntP(v interface{}, def ...int) *int
- func IsEmpty(v interface{}) bool
- func KeysE(val interface{}) (sl []interface{}, err error)
- func Len(v interface{}) int
- func Slice(v interface{}, def ...[]interface{}) []interface{}
- func SliceE(val interface{}) (sl []interface{}, err error)
- func SliceFloat64(v interface{}, def ...[]float64) []float64
- func SliceFloat64E(val interface{}) (sl []float64, err error)
- func SliceInt(v interface{}, def ...[]int) []int
- func SliceInt64(v interface{}, def ...[]int64) []int64
- func SliceInt64E(val interface{}) (sl []int64, err error)
- func SliceIntE(val interface{}) (sl []int, err error)
- func SliceString(v interface{}, def ...[]string) []string
- func SliceStringE(val interface{}) (sl []string, err error)
- func String(v interface{}, def ...string) string
- func StringE(val interface{}) (string, error)
- func StringMapE(val interface{}) (m map[string]interface{}, err error)
- func StringP(v interface{}, def ...string) *string
- func Time(v interface{}, def ...time.Time) time.Time
- func TimeE(val interface{}) (t time.Time, err error)
- func TimeInLocation(v interface{}, loc *time.Location, def ...time.Time) time.Time
- func TimeInLocationE(val interface{}, loc *time.Location) (t time.Time, err error)
- func Uint(v interface{}, def ...uint) uint
- func Uint16(v interface{}, def ...uint16) uint16
- func Uint16E(val interface{}) (uint16, error)
- func Uint16P(v interface{}, def ...uint16) *uint16
- func Uint32(v interface{}, def ...uint32) uint32
- func Uint32E(val interface{}) (uint32, error)
- func Uint32P(v interface{}, def ...uint32) *uint32
- func Uint64(v interface{}, def ...uint64) uint64
- func Uint64E(val interface{}) (uint64, error)
- func Uint64P(v interface{}, def ...uint64) *uint64
- func Uint8(v interface{}, def ...uint8) uint8
- func Uint8E(val interface{}) (uint8, error)
- func Uint8P(v interface{}, def ...uint8) *uint8
- func UintE(val interface{}) (uint, error)
- func UintP(v interface{}, def ...uint) *uint
Constants ¶
This section is empty.
Variables ¶
var TimeFormats = []string{ time.RFC3339, time.RFC1123Z, time.RFC1123, time.RFC822Z, time.RFC822, time.RFC850, time.ANSIC, time.UnixDate, time.RubyDate, time.Kitchen, time.Stamp, time.StampMilli, time.StampMicro, time.StampNano, "2006-01-02T15:04:05", "Mon Jan 2 15:04:05 2006 -0700", "2006-01-02 15:04:05.999999999 -0700 MST", "2006-01-02", "02 Jan 2006", "20060102", "20060102150405", "2006-01-02T15:04:05-0700", "2006-01-02 15:04:05 -07:00", "2006-01-02 15:04:05 -0700", "2006-01-02 15:04:05Z07:00", "2006-01-02 15:04:05Z0700", "2006-01-02 15:04:05", "2006-01-02 15:04:05.000", "2006-01-02 15:04:05.000000", "2006-01-02 15:04:05.000000000", "2006.01.02", "2006.01.02 15:04:05", "2006.01.02 15:04:05.000", "2006.01.02 15:04:05.000000", "2006.01.02 15:04:05.000000000", "2006/01/02", "2006/01/02 15:04:05", "2006/01/02 15:04:05.000", "2006/01/02 15:04:05.000000", "2006/01/02 15:04:05.000000000", "2006年01月02日", "2006年01月02日 15:04:05", "2006年01月02日 15:04:05.000", "2006年01月02日 15:04:05.000000", "2006年01月02日 15:04:05.000000000", "2006年01月02日 15时04分05秒", }
TimeFormats all supported time formats you can add your custom time format
var TimeLocation = time.UTC
TimeLocation default time location you can change this for global location if cvt < v0.2.7, Time() and TimeE() use time.Parse() to parse the time string, its default time.UTC since cvt >= v0.2.7, add TimeInLocation() and TimeInLocationE() support, add this variable to setting default time.Location
Functions ¶
func BoolP ¶ added in v0.2.3
BoolP convert and store in a new bool value, and returns a pointer to it
func ColumnsE ¶
func ColumnsE(val interface{}, field interface{}) (sl []interface{}, err error)
ColumnsE return the values from a single column in the input array/slice/map of struct/map
func Field ¶ added in v0.2.4
func Field(v interface{}, field interface{}, def ...interface{}) interface{}
Field return the field value from map/struct, with default value
func FieldE ¶
func FieldE(val interface{}, field interface{}) (interface{}, error)
FieldE return the field value from map/struct, ignore the field type
func Float32P ¶ added in v0.2.3
Float32P convert and store in a new float32 value, and returns a pointer to it
func Float64P ¶ added in v0.2.3
Float64P convert and store in a new float64 value, and returns a pointer to it
func Int16P ¶ added in v0.2.3
Int16P convert and store in a new int16 value, and returns a pointer to it
func Int32P ¶ added in v0.2.3
Int32P convert and store in a new int32 value, and returns a pointer to it
func Int64P ¶ added in v0.2.3
Int64P convert and store in a new int64 value, and returns a pointer to it
func Int8P ¶ added in v0.2.3
Int8P convert and store in a new int8 value, and returns a pointer to it
func IntMapE ¶ added in v0.2.8
IntMapE convert an interface to `map[int]interface{}` * Support JSON string of map * Support any `map` type
func IsEmpty ¶ added in v0.2.8
func IsEmpty(v interface{}) bool
IsEmpty checks value for empty state
func KeysE ¶ added in v0.1.2
func KeysE(val interface{}) (sl []interface{}, err error)
KeysE return the keys of map, sorted by asc; or fields of struct
func Len ¶ added in v0.2.8
func Len(v interface{}) int
Len return size of string, slice, array or map
func Slice ¶
func Slice(v interface{}, def ...[]interface{}) []interface{}
Slice convert an interface to a []interface{} type, with default value
func SliceE ¶
func SliceE(val interface{}) (sl []interface{}, err error)
SliceE convert an interface to a []interface{} type
func SliceFloat64 ¶ added in v0.2.4
SliceFloat64 convert an interface to a []float64 type, with default value
func SliceFloat64E ¶ added in v0.1.2
SliceFloat64E convert an interface to a []float64 type
func SliceInt64 ¶ added in v0.2.4
SliceInt64 convert an interface to a []int64 type, with default value
func SliceInt64E ¶ added in v0.1.2
SliceInt64E convert an interface to a []int64 type
func SliceString ¶ added in v0.2.4
SliceString convert an interface to a []string type, with default value
func SliceStringE ¶ added in v0.1.2
SliceStringE convert an interface to a []string type
func StringMapE ¶ added in v0.2.1
StringMapE convert an interface to `map[string]interface{}` * Support JSON string of map * Support any `map` type * Support any `struct` type
func StringP ¶ added in v0.2.3
StringP convert and store in a new string value, and returns a pointer to it
func TimeInLocation ¶ added in v0.2.7
TimeInLocation convert an interface to a time.Time type, with time.Location, with default
func TimeInLocationE ¶ added in v0.2.7
TimeInLocationE convert an interface to a time.Time type, with time.Location, with error
func Uint16P ¶ added in v0.2.3
Uint16P convert and store in a new uint16 value, and returns a pointer to it
func Uint32P ¶ added in v0.2.3
Uint32P convert and store in a new uint32 value, and returns a pointer to it
func Uint64P ¶ added in v0.2.3
Uint64P convert and store in a new uint64 value, and returns a pointer to it
Types ¶
This section is empty.