Documentation
¶
Index ¶
- func Bool2Int(b bool) int64
- func Camel2Case(name string) string
- func Case2Camel(name string) string
- func Case2LowerCamel(name string) string
- func GetCopyStructFields(source interface{}, target interface{}) []interface{}
- func GetStructFieldNames(input interface{}) []string
- func Lcfirst(str string) string
- func MapAnyToMapStr(p map[string]interface{}) map[string]string
- func StructAssign(src any, dst any) any
- func StructAssign2(src any, dst any) any
- func StructToMap(param any, data map[string]interface{}) error
- func StructToMapByReflect(obj any) map[string]any
- func StructToModelMap(param any, data map[string]any, key string) error
- func Ucfirst(str string) string
- type Buffer
- type StrTo
- func (s StrTo) Int() (int, error)
- func (s StrTo) Int64() (int64, error)
- func (s StrTo) MustInt() int
- func (s StrTo) MustInt64() int64
- func (s StrTo) MustToSize(defaultVal int64) int64
- func (s StrTo) MustUInt32() uint32
- func (s StrTo) String() string
- func (s StrTo) ToSize() (int64, error)
- func (s StrTo) UInt32() (uint32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool2Int ¶
Bool2Int converts a boolean to an integer Bool2Int 将布尔值转换为整数 b: boolean value // 布尔值 return: 1 if true, 0 if false // 返回值: true 返回 1,false 返回 0
func GetCopyStructFields ¶
func GetCopyStructFields(source interface{}, target interface{}) []interface{}
func GetStructFieldNames ¶
func GetStructFieldNames(input interface{}) []string
GetStructFields 返回传入结构体的所有字段名
func MapAnyToMapStr ¶
func StructAssign ¶
CopyStruct dst 目标结构体,src 源结构体 它会把src与dst的相同字段名的值,复制到dst中
func StructAssign2 ¶
CopyStruct dst 目标结构体,src 源结构体 它会把src与dst的相同字段名的值,复制到dst中
func StructToMap ¶
*
- @Description: 结构体map互转
- @param param interface{} 需要被转的数据
- @param data interface{} 转换完成后的数据 需要用引用传进来
- @return []string{}
func StructToMapByReflect ¶
Types ¶
type StrTo ¶
type StrTo string
func (StrTo) MustToSize ¶
MustToSize converts a string to byte size, returns default value if error occurs MustToSize 将字符串转换为字节大小,如果出错返回默认值
func (StrTo) MustUInt32 ¶
Click to show internal directories.
Click to hide internal directories.