util

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: GPL-3.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteListHex added in v0.0.10

func ByteListHex(byteList []byte) string

func CheckByteGbk added in v0.0.5

func CheckByteGbk(data []byte) bool

CheckByteGbk 判断是否存在gbk字符

func CheckNum added in v0.0.10

func CheckNum(str string, strLen int) bool

CheckNum 检查字符串0-9,固定长度,如果长度-1,仅检查字符串规则aA0

func CheckStr added in v0.0.10

func CheckStr(str string, strLen int) bool

CheckStr 检查字符串Aa0,固定长度,如果长度-1,仅检查字符串规则aA0

func CheckStrLen added in v0.0.10

func CheckStrLen(str string, strLen int) bool

CheckStrLen 检查字符串Aa0,判断字符串长度为1-strLen之间

func CheckStrMaxLen added in v0.0.10

func CheckStrMaxLen(str string, strLen int) bool

CheckStrMaxLen 检查字符串Aa0,长度最大strLen

func CheckStrMinLen added in v0.0.10

func CheckStrMinLen(str string, strLen int) bool

CheckStrMinLen 检查字符串Aa0,长度最小strLen

func ClientRemoteIpAll added in v0.0.9

func ClientRemoteIpAll(r *http.Request) string

func ClientRemoteIpOne added in v0.0.9

func ClientRemoteIpOne(r *http.Request) string

func ExecShell added in v0.0.4

func ExecShell(s string) (out []byte, err error)

ExecShell 阻塞式的执行外部shell命令的函数,等待执行完毕并返回所有输出

func FormatBytes added in v0.0.11

func FormatBytes(bytes uint64) string

func FormatFileSize added in v0.0.4

func FormatFileSize(fileSize int64) (size string)

FormatFileSize 根据字节数返回文件大小的字符串形式

func GbkToUtf8 added in v0.0.5

func GbkToUtf8(s []byte) ([]byte, error)

func GenValidateCode added in v0.0.4

func GenValidateCode(width int) string

func GetMd5String added in v0.0.4

func GetMd5String(s string) string

GetMd5String 生成32位md5字串

func If

func If(condition bool, trueVal, falseVal interface{}) interface{}

func RandStr added in v0.0.7

func RandStr(n int) string

func RandStrNum added in v0.0.7

func RandStrNum(n int) string

func RandStrValidateCode added in v0.0.7

func RandStrValidateCode(n int) string

func RandStringRunes added in v0.0.4

func RandStringRunes(n int) string

RandStringRunes 返回随机字符串

func UniqueId added in v0.0.4

func UniqueId() string

UniqueId 生成Guid字串

func Utf8ToGbk added in v0.0.5

func Utf8ToGbk(s []byte) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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