Documentation ¶
Index ¶
- Variables
- func IsEmpty(v interface{}) bool
- func IsEmptyByReflection(v reflect.Value) bool
- func ParseTime(tm string) (t time.Time, err error)
- func SetStructFieldValue(st interface{}, name string, value interface{}) error
- func StructFieldTags(st interface{}, tag string) map[string]string
- func StructFieldTagsUnsorted(st interface{}, tag string) ([]string, []string)
- func StructFieldValue(st interface{}, name string) (interface{}, error)
- func StructFields(st interface{}, tag string) []string
- func To(v, to interface{}, tags string) (interface{}, error)
- func ToBool(v interface{}) bool
- func ToBoolByReflect(v reflect.Value) bool
- func ToFloat(v interface{}) float64
- func ToFloat32(v interface{}) float32
- func ToFloat64(v interface{}) float64
- func ToFloat64ByReflect(v reflect.Value) float64
- func ToFloat64Slice(v interface{}) []float64
- func ToInt(v interface{}) int
- func ToInt16(v interface{}) int16
- func ToInt32(v interface{}) int32
- func ToInt64(v interface{}) int64
- func ToInt64ByReflect(v reflect.Value) int64
- func ToIntSlice(v interface{}) []int
- func ToInterfaceSlice(v interface{}) []interface{}
- func ToMap(dst, src interface{}, tag string, recursive bool) error
- func ToMapFrom(src interface{}, tag string, recursive bool) (map[interface{}]interface{}, error)
- func ToSiMap(src interface{}, tag string, recursive bool) (map[string]interface{}, error)
- func ToSlice(dst, src interface{}, tags string) error
- func ToString(v interface{}) string
- func ToStringByReflect(v reflect.Value) string
- func ToStringMap(src interface{}, tag string, recursive bool) (map[string]string, error)
- func ToStringSlice(v interface{}) []string
- func ToStruct(dst, src interface{}, tag string) (err error)
- func ToT(v interface{}, t reflect.Type, tags string) (interface{}, error)
- func ToType(v reflect.Value, t reflect.Type, tags string) (interface{}, error)
- func ToUint(v interface{}) uint
- func ToUint16(v interface{}) uint32
- func ToUint32(v interface{}) uint32
- func ToUint64(v interface{}) uint64
- func ToUint64ByReflect(v reflect.Value) uint64
Constants ¶
This section is empty.
Variables ¶
var ( ErrStructFieldNameUndefined = errors.New("struct field name undefined") ErrStructFieldValueCantBeChanged = errors.New("struct field value cant be changed") )
Structure method errors
var (
ErrUnsettableValue = errors.New("can't set value")
)
Error list...
Functions ¶
func IsEmptyByReflection ¶ added in v1.0.2
IsEmptyByReflection value
func SetStructFieldValue ¶ added in v1.1.0
SetStructFieldValue puts value into the struct field
func StructFieldTags ¶
StructFieldTags returns Map with key->tag matching
func StructFieldTagsUnsorted ¶
StructFieldTagsUnsorted returns field names and tag targets separately
func StructFieldValue ¶ added in v1.1.0
StructFieldValue returns the value of the struct field
func StructFields ¶
StructFields returns the field names from the structure
func ToBoolByReflect ¶
ToBoolByReflect returns boolean from reflection
func ToFloat64ByReflect ¶
ToFloat64ByReflect returns float64 from reflection
func ToFloat64Slice ¶
func ToFloat64Slice(v interface{}) []float64
ToFloat64Slice converts any input slice into Float64 type slice
func ToInt64ByReflect ¶
ToInt64ByReflect returns int64 from reflection
func ToIntSlice ¶
func ToIntSlice(v interface{}) []int
ToIntSlice converts any input slice into Int type slice
func ToInterfaceSlice ¶
func ToInterfaceSlice(v interface{}) []interface{}
ToInterfaceSlice converts any input slice into Interface type slice
func ToMap ¶
ToMap cast your Source into the Destination type tag defines the tags name in the structure to map the keys
func ToStringByReflect ¶
ToStringByReflect converts reflection value to string
func ToStringMap ¶
ToStringMap converts input Map/Object type into the map[string]string
func ToStringSlice ¶
func ToStringSlice(v interface{}) []string
ToStringSlice converts any input slice into String type slice
func ToUint16 ¶ added in v1.0.2
func ToUint16(v interface{}) uint32
ToUint32 from any other basic types
func ToUint64ByReflect ¶
ToUint64ByReflect returns uint64 from reflection
Types ¶
This section is empty.