mp_pub

package
v0.0.0-...-5b025be Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayFilter

func ArrayFilter(a []int) (ret []int)

ArrayFilter 删除int数组里的空值

func ArrayFilterString

func ArrayFilterString(a []string) (ret []string)

ArrayFilterString 删除string数组里的空值

func ArrayMergeStr

func ArrayMergeStr(a []string, b ...[]string) []string

ArrayMergeStr 合并string数组

func ArrayUnique

func ArrayUnique(arr []string) []string

ArrayUnique 保留数组中唯一值

func CheckAppID

func CheckAppID(f validator.FieldLevel) bool

CheckAppID 名称

func CheckChar

func CheckChar(f validator.FieldLevel) bool

CheckChar 验证备注

func CheckCnEnNum

func CheckCnEnNum(f validator.FieldLevel) bool

CheckCnEnNum 中英文数字

func CheckCnEnNumChar

func CheckCnEnNumChar(f validator.FieldLevel) bool

CheckCnEnNumChar 中英文数字常见字符

func CheckEgt0

func CheckEgt0(f validator.FieldLevel) bool

CheckEgt0 验证整数

func CheckEmail

func CheckEmail(f validator.FieldLevel) bool

CheckEmail 检查邮箱

func CheckEmptyString

func CheckEmptyString(keys map[string]string) string

CheckEmptyString 返回map里为空的键,逗号分隔

func CheckFloatStr

func CheckFloatStr(f validator.FieldLevel) bool

CheckFloatStr 验证float64

func CheckInt16

func CheckInt16(f validator.FieldLevel) bool

CheckInt16 验证整数

func CheckInt32

func CheckInt32(f validator.FieldLevel) bool

CheckInt32 验证整数

func CheckInt64

func CheckInt64(f validator.FieldLevel) bool

CheckInt64 验证整数

func CheckIntStr

func CheckIntStr(f validator.FieldLevel) bool

CheckIntStr 验证数字

func CheckKey

func CheckKey(f validator.FieldLevel) bool

CheckKey 验证Key

func CheckKeys

func CheckKeys(f validator.FieldLevel) bool

CheckKeys 验证Keys

func CheckKeyword

func CheckKeyword(f validator.FieldLevel) bool

CheckKeyword 验证关键字

func CheckMD5

func CheckMD5(f validator.FieldLevel) bool

CheckMD5 验证MD5

func CheckName

func CheckName(f validator.FieldLevel) bool

CheckName 名称

func CheckPassWd

func CheckPassWd(f validator.FieldLevel) bool

CheckPassWd 验证密码

func CheckPhone

func CheckPhone(f validator.FieldLevel) bool

CheckPhone 检查手机

func CheckRemark

func CheckRemark(f validator.FieldLevel) bool

CheckRemark 名称

func CheckRoute

func CheckRoute(f validator.FieldLevel) bool

CheckRoute 验证路由

func CheckText

func CheckText(f validator.FieldLevel) bool

CheckText 验证文本

func CheckTrueFalse

func CheckTrueFalse(f validator.FieldLevel) bool

CheckTrueFalse 验证是与否

func CheckUnionSn

func CheckUnionSn(f validator.FieldLevel) bool

CheckUnionSn 验证唯一标识

func CheckUrl

func CheckUrl(f validator.FieldLevel) bool

CheckUrl 验证url

func CheckUser

func CheckUser(f validator.FieldLevel) bool

CheckUser 验证用户名

func CmdExecWindows

func CmdExecWindows(c string, cmdPath string) string

CmdExecWindows 执行cmd指令

func CreateMultiDir

func CreateMultiDir(filePath string) error

CreateMultiDir 调用os.MkdirAll递归创建文件夹

func DeBmUrlStr

func DeBmUrlStr(key string, str string) string

DeBmUrlStr 保命图片解析字符串

func Die

func Die(t ...interface{})

Die 退出

func E

func E(msg string) error

E 返回错误信息

func Echo

func Echo(a ...interface{})

func EchoFail

func EchoFail(str string)

EchoFail 失败输出

func EchoInfo

func EchoInfo(str string)

EchoInfo 信息输出

func EchoPlus

func EchoPlus(str string, color string, bg string, highLight string)

EchoPlus 带特效输出

func EchoSuccess

func EchoSuccess(str string)

EchoSuccess 成功输出

func EchoWarning

func EchoWarning(str string)

EchoWarning 警告输出

func Err

func Err(e error)

Err 如果err不是nil打印err

func ExecCommand

func ExecCommand(name, sangS string) error

ExecCommand 执行命令

func ExitGoFunc

func ExitGoFunc(done chan int)

ExitGoFunc 退出协程

func ExplodeInt

func ExplodeInt(s string, sp string) (its []int)

ExplodeInt 根据字符分隔字符串为字符串数组,并删除空值

func ExplodeStr

func ExplodeStr(s string, sp string) []string

ExplodeStr 根据字符分隔字符串为字符串数组,并删除空值

func FileGetContent

func FileGetContent(path string) (string, error)

FileGetContent 读取文件

func FilterMapEmpty

func FilterMapEmpty(mp map[string]interface{}, ign []string) map[string]interface{}

FilterMapEmpty 过滤为空的map和忽略的map,保留不为空和忽略字段

func FilterStr

func FilterStr(strs []string) []string

FilterStr 删除字符串数组中的空值

func GetMaxProcess

func GetMaxProcess()

GetMaxProcess 获取CPU最大同时数量

func GetProcessByCmd

func GetProcessByCmd(cmd string) (pn *process.Process, e error)

GetProcessByCmd 根据cmd命令获取对应的pid

func GetRandPort

func GetRandPort() (port int)

GetRandPort 获取随机端口

func GetRelativePath

func GetRelativePath() (rootDir string, e error)

GetRelativePath 获取运行程序的相对路径

func GetSysBit

func GetSysBit() int

GetSysBit 获取当前系统是32位还是64位

func InArrayStr

func InArrayStr(one string, arr []string) bool

InArrayStr 判断字符串元素是否在数组中存在

func InitBaseApi

func InitBaseApi(bm []string, key string, oldSign string) (err error, uri string, sign string)

InitBaseApi 初始化获取域名

func MapToQuery

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

MapToQuery map转get的参数

func MyDate

func MyDate(Format interface{}, UnixTime interface{}) string

MyDate 时间戳转换为字符串

func Now

func Now() int

Now 返回当前时间戳

func OpenTrans

func OpenTrans()

OpenTrans 开启Linux转发

func PathJoin

func PathJoin(p ...string) string

PathJoin 根据系统不同组合路径

func Pln

func Pln(a ...interface{})

Pln 打印

func ProcessId

func ProcessId() (pid []int32)

ProcessId 获取所有进程id,以数组返回

func ProcessName

func ProcessName() (pname []string)

ProcessName 获取所有进程名,以数组返回

func RegValidate

func RegValidate()

RegValidate 注册校验

func SendMail

func SendMail(d def.SendMailSt) error

SendMail 邮件发送封装

func ShellExec

func ShellExec(c string, cmdShow bool, runtimeShow bool) string

ShellExec 执行shell,同步

func ShellExecEcho

func ShellExecEcho(c string) string

ShellExecEcho 执行shell,显示详情

func ShellExecEchoDisable

func ShellExecEchoDisable(c string) string

ShellExecEchoDisable 执行shell,不显示详情

func ShellRt

func ShellRt(c string, showCmd bool) string

ShellRt 执行指令并返回值

func SleepMs

func SleepMs(sec int)

SleepMs 休眠ms秒

func SleepNs

func SleepNs(sec int)

SleepNs 休眠纳秒

func SleepSec

func SleepSec(sec int)

SleepSec 延迟sec秒

func SleepSecCount

func SleepSecCount(sec int)

SleepSecCount 延迟sec秒,倒计时显示

func SleepUs

func SleepUs(sec int)

SleepUs 休眠微秒

func Str2Float

func Str2Float(str string) float64

Str2Float 字符串转int

func Str2Int

func Str2Int(str string) int

Str2Int 字符串转int

func StrSplit

func StrSplit(str string, ls int) (s []string)

StrSplit 字符串按照指定长度分隔到slice里

func StrToTime

func StrToTime(tStr string) int

StrToTime 字符串转换为时间(layerOut和变换时间应格式相同)

func StructToMap

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

StructToMap 结构体转换为map类型

func ValidateAndOpError

func ValidateAndOpError(s interface{}) (err error, msg string)

ValidateAndOpError 验证字段,如果有误返回错误信息否则返回nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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