Documentation ¶
Index ¶
- Constants
- func ArrayToStr(arr interface{}, delimiter string) (re string)
- func Average(arr []float64) (avg float64)
- func CallReflect(any interface{}, name string, args ...interface{}) []reflect.Value
- func CentToYuan(points interface{}) string
- func CentToYuanClearZero(points interface{}) (re string)
- func DataToJsonStr(value interface{}) (re string, err error)
- func Decimal(value float64, decimal int) float64
- func DelFromArr(arr interface{}, index int) []interface{}
- func FormatDirStr(dirPath string) (re string)
- func FormatFloatToString(data interface{}, decimal ...int) string
- func FormatIntToLength(value int64, length int) string
- func FormatPrice(price interface{}) string
- func GenerateRandomString(length int) string
- func GenerateUuid() string
- func GetConfig(configName string) (re string, err error)
- func GetConfigLevel(levelId int) (re *entity.ConfigLevel, err error)
- func GetConfigMidjourney(id int64) (re *entity.ConfigMidjourney, err error)
- func GetMapValueByKey(data map[string]interface{}, key string) string
- func GetRandStr(n int) (randStr string)
- func GetWalletName(field string) (re string)
- func IntInArr(arr interface{}, element int) bool
- func ItemIsInSlice(slice []string, val string) (int, bool)
- func JSONToMap(jsonData string) (re map[string]interface{}, err error)
- func JSONToSlice(jsonData string) (re []interface{}, err error)
- func MakeRange(start int, count int, step int) []int
- func MapDataValueToString(data interface{}, fields ...interface{}) (reData map[string]interface{})
- func MapKeySortToUrlParams(dataMap map[string]interface{}, urlEncode bool) (re string)
- func MapSort(mapData interface{}, sortType int, fieldName ...string) (re []interface{})
- func MapToURLParams(paramsMap map[string]interface{}) (re string)
- func MergeMaps(maps ...map[string]interface{}) (re map[string]interface{})
- func MergeStr(strings []string) string
- func RandInt64(min, max int64) int64
- func RandNumUniqueInt(min, max int, num int) []int
- func RandSliceValue(xs []string) string
- func RemoveFile(filePath string) (err error)
- func RemoveKeys(list []map[string]interface{}, keys []string) []map[string]interface{}
- func Round(x float64) int
- func SliceDataValueAllToString(data interface{}) (re interface{})
- func SliceDataValueToString(data interface{}, fields ...interface{}) (listData []map[string]interface{})
- func SortIntSlice(sortSlice *[]int)
- func StrInArr(arr interface{}, str string) bool
- func StrToArray(str string, delimiter string) (re []string)
- func SubStr(source interface{}, start int, end int) string
- func TypeOf(v interface{}) string
- func ULen(source interface{}) int
- func URLDecode(urlStr string) string
- func URLEncode(urlStr string) string
- func URLParamsToMap(paramsStr string) (re map[string]interface{}, err error)
- func YuanToCent(yuan interface{}) int
- type FileTypeInfo
Constants ¶
View Source
const ( // MapSortTypeKey 按照键排序 MapSortTypeKey = 1 // MapSortTypeValue 按照值排序 MapSortTypeValue = 2 // MapSortTypeField 按照二维map中的字段排序 MapSortTypeField = 3 )
Variables ¶
This section is empty.
Functions ¶
func ArrayToStr ¶
ArrayToStr 数组转为符号分隔的字符串
func CallReflect ¶
CallReflect 用反射的方法调用对象的方法
func CentToYuanClearZero ¶
func CentToYuanClearZero(points interface{}) (re string)
CentToYuanClearZero 格式化金额去除后面的零
func DataToJsonStr ¶
DataToJsonStr 任意数据转换成为json格式的字符串 基本类型只转换类型 布尔值转换为1和0 其他转换为 json 字符串
func FormatFloatToString ¶
FormatFloatToString 浮点型数值转字符串保留小数
func FormatIntToLength ¶
FormatIntToLength 格式化数字以前导0补齐
func GenerateRandomString ¶
GenerateRandomString 生成随机字符串
func GetConfigLevel ¶
func GetConfigLevel(levelId int) (re *entity.ConfigLevel, err error)
GetConfigLevel 获取级别配置信息
func GetConfigMidjourney ¶
func GetConfigMidjourney(id int64) (re *entity.ConfigMidjourney, err error)
func GetMapValueByKey ¶
GetMapValueByKey map是否存在字段,存在返回值,不存在返回空字符串
func JSONToSlice ¶
JSONToSlice json转数组
func MapDataValueToString ¶
func MapDataValueToString(data interface{}, fields ...interface{}) (reData map[string]interface{})
MapDataValueToString map数据内容转字符串
func MapKeySortToUrlParams ¶
MapKeySortToUrlParams 对map的key进行排序并生成url参数形式
func MapToURLParams ¶
MapToURLParams map转url参数
func RandSliceValue ¶
func RemoveKeys ¶
RemoveKeys 移除list中不需要的key
func SliceDataValueAllToString ¶
func SliceDataValueAllToString(data interface{}) (re interface{})
SliceDataValueAllToString 数组中的map值全都转字符串
func SliceDataValueToString ¶
func SliceDataValueToString(data interface{}, fields ...interface{}) (listData []map[string]interface{})
SliceDataValueToString 列表数据内容转字符串
func URLParamsToMap ¶
URLParamsToMap url参数转map
Types ¶
type FileTypeInfo ¶
func GetFileExtName ¶
func GetFileExtName(filePath string) (re *FileTypeInfo, err error)
GetFileExtName 获取文件的扩展名
func GetFileType ¶
func GetFileType(fSrc []byte) *FileTypeInfo
GetFileType 用文件前面几个字节来判断 fSrc: 文件字节流(就用前面几个字节)
Click to show internal directories.
Click to hide internal directories.