Documentation ¶
Index ¶
- func Camel2Case(name string) string
- func Case2Camel(name string) string
- func Div(Num int) string
- func GetFloat32ValueInMap(mapData map[string]interface{}, key string) float32
- func GetInt32ValueInMap(mapData map[string]interface{}, key string) int32
- func GetInt64ValueInMap(mapData map[string]interface{}, key string) int64
- func InterfaceToInt32(v interface{}) int32
- func JSONDecode(data []byte, v interface{}) error
- func JSONEncode(data interface{}, format ...bool) ([]byte, error)
- func LcFirst(str string) string
- func StructAssign(binding interface{}, value interface{})
- func ToMap(in interface{}, tagName string) (map[string]interface{}, error)
- func UcFirst(str string) string
- type Buffer
- type JsonCamelCase
- type JsonSnakeCase
- type StrTo
- func (s StrTo) Int() (int, error)
- func (s StrTo) Int32() (int32, error)
- func (s StrTo) Int64() (int64, error)
- func (s StrTo) Int8() (int8, error)
- func (s StrTo) MustInt() int
- func (s StrTo) MustInt32() int32
- func (s StrTo) MustInt64() int64
- func (s StrTo) MustInt8() int8
- func (s StrTo) MustUInt32() uint32
- func (s StrTo) MustUInt64() uint64
- func (s StrTo) String() string
- func (s StrTo) ToIntArr() []int32
- func (s StrTo) UInt32() (uint32, error)
- func (s StrTo) UInt64() (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFloat32ValueInMap ¶ added in v0.0.18
func GetInt32ValueInMap ¶ added in v0.0.18
GetInt32ValueInMap 提取数据
func GetInt64ValueInMap ¶ added in v0.0.18
func InterfaceToInt32 ¶ added in v0.0.18
func InterfaceToInt32(v interface{}) int32
InterfaceToInt32 转int32
func JSONDecode ¶
JSONDecode 规避json解析浮点数出现的精度问题 https://www.jianshu.com/p/2b4a3cda0f6f
func JSONEncode ¶
JSONEncode 将结构体转成json字节流, 结构体以驼峰展示,且输出格式化
func StructAssign ¶ added in v0.1.2
func StructAssign(binding interface{}, value interface{})
StructAssign 将value 中的值赋值到 bingding 中, 需要字段名, 字段类型一致 binding type interface 要修改的结构体 value type interace 有数据的结构体
Types ¶
type JsonCamelCase ¶
type JsonCamelCase struct {
Value interface{}
}
JsonCamelCase json struct 驼峰自动转下划线
func (JsonCamelCase) MarshalJSON ¶
func (c JsonCamelCase) MarshalJSON() ([]byte, error)
type JsonSnakeCase ¶
type JsonSnakeCase struct {
Value interface{}
}
JsonSnakeCase json struct 驼峰自动转下划线
func (JsonSnakeCase) MarshalJSON ¶
func (c JsonSnakeCase) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.