common

package
v0.0.0-...-2ec961a Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppSignature_MD5

func AppSignature_MD5(appid, appkey string, params map[string]string) string

func Base64ToImg

func Base64ToImg(datasource string, dirpath string) string

Base64图片编码写入文件

func Build_QRFile

func Build_QRFile(qurl string, dirstr string) string

func Byte2str

func Byte2str(postdata []map[string][]byte) []map[string]interface{}

func CheckProRunning

func CheckProRunning(serverName string) (bool, error)

根据进程名判断进程是否运行

func Check_array_in

func Check_array_in(val string, data []string) bool

检查是否在数组内

func ConvertNumToCny

func ConvertNumToCny(num float64) string

func CopyFile

func CopyFile(srcFile, dstFile string) (int64, error)

func DataToStruct

func DataToStruct(data map[string]string, out interface{})

map转结构体

func Down_http_file

func Down_http_file(data map[string]string)

func Eval

func Eval(code string, imports ...string) (result string, err error)

func FilteredSQLInject

func FilteredSQLInject(to_match_str string) bool

func GetBase64FromFile

func GetBase64FromFile(filename string) (string, error)

func GetPid

func GetPid(serverName string) (string, error)

根据进程名称获取进程ID

func GetRangStr

func GetRangStr(fw int) string

func GetYearMonthToDay

func GetYearMonthToDay(year int, month int) int

func Get_FIle_Size

func Get_FIle_Size(path string) int64

获取单个文件的大小

func Get_Save_FileName

func Get_Save_FileName(filestr, dirstr string) string

func Get_UUID

func Get_UUID() string

func Get_Upload_filename

func Get_Upload_filename(filestr, dirstr string) string

func Getini

func Getini(config_file, action string, post_data map[string]string) map[string]string

func Has_map_index

func Has_map_index(name string, data map[string]interface{}) bool

func ImageResetSize

func ImageResetSize(filename string)

func Int2Date_str

func Int2Date_str(date int64) string

func Int2Time_str

func Int2Time_str(date int64) string

func Int64toint

func Int64toint(val int64) int

func IsExist

func IsExist(path string) bool

func Map2Xml

func Map2Xml(params map[string]string) string

map转xml

func Map2str

func Map2str(postdata map[string]interface{}) map[string]string

func MapString2interface

func MapString2interface(data map[string]string) map[string]interface{}

func PathExists

func PathExists(dirpath string) bool

func RandomStr

func RandomStr(length int) string

func ReadStringFile

func ReadStringFile(filename string) string

func RunCommand

func RunCommand(cmd string) (string, error)

func SaveBase64ToFile

func SaveBase64ToFile(bs64, filename string) error

func SendToMail

func SendToMail(user, password, host, to, subject, body, mailtype string) error

func Send_mail_public

func Send_mail_public(title, mailto, mailbody string) int

func Shell_linux_Command

func Shell_linux_Command(cmdstr string) (string, error)

func Shell_linux_exec

func Shell_linux_exec(cmdstr string) error

func Shell_win_exec

func Shell_win_exec(cmdstr string)

func Signature_MD5

func Signature_MD5(appid, appkey string, params map[string]string) string

func Signature_sha1

func Signature_sha1(appid, appkey string, params map[string]string) string

func String2Time

func String2Time(date string) int64

func Struct2Map

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

结构转map

func ToUP_map_name

func ToUP_map_name(name string) string

下划线转驼峰写法转写法

func Tolow_map_name

func Tolow_map_name(name string) string

驼峰写法转下划线写法

func Type2str

func Type2str(val interface{}) string

func Upload_File

func Upload_File(r *http.Request, uploadfile string) []string

func Upload_post_web_file

func Upload_post_web_file(r *http.Request) ([]string, []string)

func Upload_web_file

func Upload_web_file(r *http.Request) []string

func WriteStringFile

func WriteStringFile(filename, memo string) error

func Xml2Map

func Xml2Map(in interface{}) (map[string]string, error)

xml转map

Types

This section is empty.

Jump to

Keyboard shortcuts

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