utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addslashes

func Addslashes(v string) string

func ArrayDiff

func ArrayDiff(array1 []string, array2 []string) []string

func Byte2String

func Byte2String(bytes int64, unit string, returnUnit bool) string

字节转字符串

func CheckFileName

func CheckFileName(file []string) (bool, string)

检查文件名格式 小写英文、数字、连字符、下划线、点

func DataTimeFormat

func DataTimeFormat(array []interface{}, fields string, format string) []interface{}

* * array数据 格式化子元素的时间 * fields - 需要格式化为时间的字段名,多个字段用逗号隔开 * format - 时间格式

func EncodeMD5

func EncodeMD5(s string) string

func FileAppend

func FileAppend(logFile string, data string)

func GetIPAdress

func GetIPAdress(r *http.Request) string

客户端IP

func GetKey

func GetKey(array map[string]interface{}) []string

func GetMapValueByKey

func GetMapValueByKey(data interface{}, key string) string

适用于无法判断data为map类型的结构

func IsIP

func IsIP(ip string) (b bool)

func IsMysqlName

func IsMysqlName(name string) bool

func IsPasswd

func IsPasswd(name string) bool

func IsValid

func IsValid(name string) bool

func JsonToArr

func JsonToArr(json string) []interface{}

func LcFirst

func LcFirst(str string) string

func MkKey

func MkKey(array []interface{}, key string, keyOnly bool) map[string]interface{}

func MkKeyValue

func MkKeyValue(array []interface{}, key string, value string) map[string]interface{}

func MkMaxKeyValue

func MkMaxKeyValue(array []interface{}, key string, value string, maxKey string) map[string]interface{}

func ParseFormCollection

func ParseFormCollection(r *http.Request, typeName string, mustHave string) []map[string]string

处理http提交的二维数组

func ToInt

func ToInt(value interface{}) int

func ToInt64

func ToInt64(value interface{}) int64

func ToString

func ToString(arg interface{}) string

func UcFirst

func UcFirst(str string) string

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