tools

package
v0.0.0-...-3fc60fe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Rnd = rand.New(rand.NewSource(time.Now().UnixNano()))

随机数种子

Functions

func Exists

func Exists(path string) bool

func GetRandDigit

func GetRandDigit(n int) string

获取数字随机字符

func Json2Map

func Json2Map(jsonstr []byte) (s map[string]string, err error)

func MD5

func MD5(data string) string

md5加密

func MD5Encrypt16

func MD5Encrypt16(data string) string

func NewUploadRequest

func NewUploadRequest(linkUrl string, params map[string]string, name, path string) (*http.Request, error)

新建上传请求

func PageCount

func PageCount(count, pagesize int) int

func RandIntNum

func RandIntNum(min, max int64) int64

func ReadFile

func ReadFile(path string) ([]byte, error)

func SetField

func SetField(obj interface{}, name string, value interface{}) error

func SortMapByKey2Str

func SortMapByKey2Str(m map[string]interface{}) string

sort map by key

func StartIndex

func StartIndex(page, pagesize int) int

func StrListToString

func StrListToString(strList []string) (str string)

将字符串数组转化为逗号分割的字符串形式 ["str1","str2","str3"] >>> "str1,str2,str3"

func Struct2Map

func Struct2Map(obj interface{}) map[string]interface{}

func SubFloatToFloat

func SubFloatToFloat(f float64, m int) float64

截取小数点后几位

func SubFloatToString

func SubFloatToString(f float64, m int) string

截取小数点后几位

func ToString

func ToString(v interface{}) string

序列化

func UrlEncode

func UrlEncode(s string) string

func Version2Flt

func Version2Flt(appversion string) (version float64)

func VersionToInt

func VersionToInt(version string) int

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL