Documentation ¶
Index ¶
- Constants
- Variables
- func CallFunc(f interface{}, args ...interface{}) (results []interface{}, err error)
- func GetFieldValue(arr interface{}, fieldName string) (res interface{}, err error)
- func GetVariatePointerAddr(val interface{}) int64
- func GetVariateType(v interface{}) string
- func IsPointer(val interface{}, notNil bool) (res bool)
- func VerifyFunc(f interface{}, args ...interface{}) (vf reflect.Value, vargs []reflect.Value, err error)
- type BiosInfo
- type BoardInfo
- type CallBack
- type CpuInfo
- type FileFilter
- type LkkArrCompareType
- type LkkArray
- func (ka *LkkArray) ArrayChunk(arr interface{}, size int) [][]interface{}
- func (ka *LkkArray) ArrayColumn(arr interface{}, columnKey string) []interface{}
- func (ka *LkkArray) ArrayDiff(arr1, arr2 interface{}, compareType LkkArrCompareType) map[interface{}]interface{}
- func (ka *LkkArray) ArrayFlip(arr interface{}) map[interface{}]interface{}
- func (ka *LkkArray) ArrayIntersect(arr1, arr2 interface{}, compareType LkkArrCompareType) map[interface{}]interface{}
- func (ka *LkkArray) ArrayKeyExists(key interface{}, arr interface{}) bool
- func (ka *LkkArray) ArrayKeys(arr interface{}) []interface{}
- func (ka *LkkArray) ArrayPad(arr interface{}, size int, item interface{}) []interface{}
- func (ka *LkkArray) ArrayRand(arr interface{}, num int) []interface{}
- func (ka *LkkArray) ArrayReverse(arr interface{}) []interface{}
- func (ka *LkkArray) ArraySearchItem(arr interface{}, condition map[string]interface{}) (res interface{})
- func (ka *LkkArray) ArraySearchMutil(arr interface{}, condition map[string]interface{}) (res []interface{})
- func (ka *LkkArray) ArrayShuffle(arr interface{}) []interface{}
- func (ka *LkkArray) ArrayUnique(arr interface{}) map[interface{}]interface{}
- func (ka *LkkArray) ArrayValues(arr interface{}, filterZero bool) []interface{}
- func (ka *LkkArray) CutSlice(arr interface{}, offset, size int) []interface{}
- func (ka *LkkArray) DeleteSliceItems(val interface{}, ids ...int) (res []interface{}, del int)
- func (ka *LkkArray) Implode(delimiter string, arr interface{}) string
- func (ka *LkkArray) InArray(needle interface{}, haystack interface{}) bool
- func (ka *LkkArray) InInt64Slice(i int64, list []int64) bool
- func (ka *LkkArray) InIntSlice(i int, list []int) bool
- func (ka *LkkArray) InStringSlice(str string, list []string) bool
- func (ka *LkkArray) IsArray(val interface{}) bool
- func (ka *LkkArray) IsArrayOrSlice(val interface{}) bool
- func (ka *LkkArray) IsEqualArray(arr1, arr2 interface{}) bool
- func (ka *LkkArray) IsEqualMap(arr1, arr2 interface{}) bool
- func (ka *LkkArray) IsMap(val interface{}) bool
- func (ka *LkkArray) IsSlice(val interface{}) bool
- func (ka *LkkArray) IsStruct(val interface{}) bool
- func (ka *LkkArray) JoinInts(delimiter string, ints []int) (res string)
- func (ka *LkkArray) JoinStrings(delimiter string, strs []string) (res string)
- func (ka *LkkArray) Length(val interface{}) int
- func (ka *LkkArray) MergeMap(ss ...interface{}) map[interface{}]interface{}
- func (ka *LkkArray) MergeSlice(filterZero bool, ss ...interface{}) []interface{}
- func (ka *LkkArray) NewStrMapItf() map[string]interface{}
- func (ka *LkkArray) NewStrMapStr() map[string]string
- func (ka *LkkArray) SliceFill(val interface{}, num int) []interface{}
- func (ka *LkkArray) SlicePop(s *[]interface{}) interface{}
- func (ka *LkkArray) SlicePush(s *[]interface{}, elements ...interface{}) int
- func (ka *LkkArray) SliceShift(s *[]interface{}) interface{}
- func (ka *LkkArray) SliceUnshift(s *[]interface{}, elements ...interface{}) int
- func (ka *LkkArray) Unique64Ints(ints []int64) (res []int64)
- func (ka *LkkArray) UniqueInts(ints []int) (res []int)
- func (ka *LkkArray) UniqueStrings(strs []string) (res []string)
- type LkkCaseSwitch
- type LkkConvert
- func (kc *LkkConvert) BaseConvert(num string, frombase, tobase int) (string, error)
- func (kc *LkkConvert) Bin2Dec(str string) (int64, error)
- func (kc *LkkConvert) Bin2Hex(str string) (string, error)
- func (kc *LkkConvert) Bool2Int(val bool) int
- func (kc *LkkConvert) Bool2Str(val bool) string
- func (kc *LkkConvert) Byte2Float64(bytes []byte) float64
- func (kc *LkkConvert) Byte2Hex(val []byte) string
- func (kc *LkkConvert) Byte2Hexs(val []byte) []byte
- func (kc *LkkConvert) Byte2Int64(val []byte) int64
- func (kc *LkkConvert) Bytes2Str(val []byte) string
- func (kc *LkkConvert) Bytes2StrUnsafe(val []byte) string
- func (kc *LkkConvert) Dec2Bin(num int64) string
- func (kc *LkkConvert) Dec2Hex(num int64) string
- func (kc *LkkConvert) Dec2Oct(num int64) string
- func (kc *LkkConvert) Float2Str(val interface{}, decimal int) string
- func (kc *LkkConvert) Float64ToByte(val float64) []byte
- func (kc *LkkConvert) Hex2Bin(str string) (string, error)
- func (kc *LkkConvert) Hex2Byte(str string) []byte
- func (kc *LkkConvert) Hex2Dec(str string) (int64, error)
- func (kc *LkkConvert) Hexs2Byte(val []byte) []byte
- func (kc *LkkConvert) Int2Str(val interface{}) string
- func (kc *LkkConvert) Int64ToByte(val int64) []byte
- func (kc *LkkConvert) Ip2Long(ipAddress string) uint32
- func (kc *LkkConvert) IsBinary(s string) bool
- func (kc *LkkConvert) IsBool(val interface{}) bool
- func (kc *LkkConvert) IsByte(val interface{}) bool
- func (kc *LkkConvert) IsEmpty(val interface{}) bool
- func (kc *LkkConvert) IsFloat(val interface{}) bool
- func (kc *LkkConvert) IsHex(str string) bool
- func (kc *LkkConvert) IsInt(val interface{}) bool
- func (kc *LkkConvert) IsInterface(val interface{}) bool
- func (kc *LkkConvert) IsNil(val interface{}) bool
- func (kc *LkkConvert) IsNumeric(val interface{}) bool
- func (kc *LkkConvert) IsPort(val interface{}) bool
- func (kc *LkkConvert) IsString(val interface{}) bool
- func (kc *LkkConvert) IsStruct(val interface{}) bool
- func (kc *LkkConvert) Long2Ip(properAddress uint32) string
- func (kc *LkkConvert) Oct2Dec(str string) (int64, error)
- func (kc *LkkConvert) Runes2Bytes(rs []rune) []byte
- func (kc *LkkConvert) Str2Bool(val string) bool
- func (kc *LkkConvert) Str2Bytes(val string) []byte
- func (kc *LkkConvert) Str2BytesUnsafe(val string) []byte
- func (kc *LkkConvert) Str2Float32(val string) float32
- func (kc *LkkConvert) Str2Float64(val string) float64
- func (kc *LkkConvert) Str2Int(val string) int
- func (kc *LkkConvert) Str2Int16(val string) int16
- func (kc *LkkConvert) Str2Int32(val string) int32
- func (kc *LkkConvert) Str2Int64(val string) int64
- func (kc *LkkConvert) Str2Int8(val string) int8
- func (kc *LkkConvert) Str2Uint(val string) uint
- func (kc *LkkConvert) Str2Uint16(val string) uint16
- func (kc *LkkConvert) Str2Uint32(val string) uint32
- func (kc *LkkConvert) Str2Uint64(val string) uint64
- func (kc *LkkConvert) Str2Uint8(val string) uint8
- func (kc *LkkConvert) Struct2Map(obj interface{}, tagName string) (map[string]interface{}, error)
- func (kc *LkkConvert) ToBool(val interface{}) bool
- func (kc *LkkConvert) ToFloat(val interface{}) (res float64)
- func (kc *LkkConvert) ToInt(val interface{}) int
- func (kc *LkkConvert) ToStr(val interface{}) string
- type LkkDebug
- func (kd *LkkDebug) CallMethod(t interface{}, method string, args ...interface{}) ([]interface{}, error)
- func (ks *LkkDebug) DumpPrint(vs ...interface{})
- func (kd *LkkDebug) DumpStacks()
- func (kd *LkkDebug) GetCallDir() string
- func (kd *LkkDebug) GetCallFile() string
- func (kd *LkkDebug) GetCallLine() int
- func (kd *LkkDebug) GetCallName(f interface{}, onlyFun bool) string
- func (kd *LkkDebug) GetCallPackage(callFile ...string) string
- func (kd *LkkDebug) GetFuncNames(obj interface{}) (res []string)
- func (kd *LkkDebug) GetMethod(t interface{}, method string) interface{}
- func (kd *LkkDebug) HasMethod(t interface{}, method string) bool
- type LkkEncrypt
- func (ke *LkkEncrypt) AesCBCDecrypt(cipherText, key []byte, paddingType ...LkkPKCSType) ([]byte, error)
- func (ke *LkkEncrypt) AesCBCEncrypt(clearText, key []byte, paddingType ...LkkPKCSType) ([]byte, error)
- func (ke *LkkEncrypt) AesCFBDecrypt(cipherText, key []byte) ([]byte, error)
- func (ke *LkkEncrypt) AesCFBEncrypt(clearText, key []byte) ([]byte, error)
- func (ke *LkkEncrypt) AesCTRDecrypt(cipherText, key []byte) ([]byte, error)
- func (ke *LkkEncrypt) AesCTREncrypt(clearText, key []byte) ([]byte, error)
- func (ke *LkkEncrypt) AesOFBDecrypt(cipherText, key []byte) ([]byte, error)
- func (ke *LkkEncrypt) AesOFBEncrypt(clearText, key []byte) ([]byte, error)
- func (ke *LkkEncrypt) AuthCode(str, key []byte, encode bool, expiry int64) ([]byte, int64)
- func (ke *LkkEncrypt) Base64Decode(str []byte) ([]byte, error)
- func (ke *LkkEncrypt) Base64Encode(str []byte) []byte
- func (ke *LkkEncrypt) Base64UrlDecode(str []byte) ([]byte, error)
- func (ke *LkkEncrypt) Base64UrlEncode(str []byte) []byte
- func (ke *LkkEncrypt) EasyDecrypt(val, key []byte) []byte
- func (ke *LkkEncrypt) EasyEncrypt(data, key []byte) []byte
- func (ke *LkkEncrypt) GenerateRsaKeys(bits int) (private []byte, public []byte, err error)
- func (ke *LkkEncrypt) HmacShaX(data, secret []byte, x uint16) []byte
- func (ke *LkkEncrypt) PasswordHash(password []byte, costs ...int) ([]byte, error)
- func (ke *LkkEncrypt) PasswordVerify(password, hash []byte) bool
- func (ke *LkkEncrypt) RsaPrivateDecrypt(cipherText, privateKey []byte) ([]byte, error)
- func (ke *LkkEncrypt) RsaPrivateEncrypt(clearText, privateKey []byte) ([]byte, error)
- func (ke *LkkEncrypt) RsaPublicDecrypt(cipherText, publicKey []byte) ([]byte, error)
- func (ke *LkkEncrypt) RsaPublicEncrypt(clearText, publicKey []byte) ([]byte, error)
- type LkkFile
- func (kf *LkkFile) AbsPath(fpath string) string
- func (kf *LkkFile) AppendFile(fpath string, data []byte) error
- func (kf *LkkFile) Basename(fpath string) string
- func (kf *LkkFile) ChmodBatch(fpath string, filemode, dirmode os.FileMode) (res bool)
- func (kf *LkkFile) CopyDir(source string, dest string, cover LkkFileCover) (int64, error)
- func (kf *LkkFile) CopyFile(source string, dest string, cover LkkFileCover) (int64, error)
- func (kf *LkkFile) CopyLink(source string, dest string) error
- func (kf *LkkFile) CountLines(fpath string, buffLength int) (int, error)
- func (kf *LkkFile) DelDir(dir string, delete bool) error
- func (kf *LkkFile) DirSize(fpath string) int64
- func (kf *LkkFile) Dirname(fpath string) string
- func (kf *LkkFile) FastCopy(source string, dest string) (int64, error)
- func (kf *LkkFile) FileSize(fpath string) int64
- func (kf *LkkFile) FileTree(fpath string, ftype LkkFileTree, recursive bool, filters ...FileFilter) []string
- func (kf *LkkFile) FormatDir(fpath string) string
- func (kf *LkkFile) FormatPath(fpath string) string
- func (kf *LkkFile) GetExt(fpath string) string
- func (kf *LkkFile) GetFileMode(fpath string) (os.FileMode, error)
- func (kf *LkkFile) GetMime(fpath string, fast bool) string
- func (kf *LkkFile) GetModTime(fpath string) (res int64)
- func (kf *LkkFile) Glob(pattern string) ([]string, error)
- func (kf *LkkFile) Img2Base64(fpath string) (string, error)
- func (kf *LkkFile) IsBinary(fpath string) bool
- func (kf *LkkFile) IsDir(fpath string) bool
- func (kf *LkkFile) IsExecutable(fpath string) bool
- func (kf *LkkFile) IsExist(fpath string) bool
- func (kf *LkkFile) IsFile(fpath string, ftype ...LkkFileType) (res bool)
- func (kf *LkkFile) IsImg(fpath string) bool
- func (kf *LkkFile) IsLink(fpath string) bool
- func (kf *LkkFile) IsReadable(fpath string) bool
- func (kf *LkkFile) IsWritable(fpath string) bool
- func (kf *LkkFile) IsZip(fpath string) bool
- func (kf *LkkFile) Md5(fpath string, length uint8) (string, error)
- func (kf *LkkFile) Mkdir(fpath string, mode os.FileMode) error
- func (kf *LkkFile) Pathinfo(fpath string, option int) map[string]string
- func (kf *LkkFile) ReadFile(fpath string) ([]byte, error)
- func (kf *LkkFile) ReadFirstLine(fpath string) []byte
- func (kf *LkkFile) ReadInArray(fpath string) ([]string, error)
- func (kf *LkkFile) ReadLastLine(fpath string) []byte
- func (kf *LkkFile) RealPath(fpath string) string
- func (kf *LkkFile) Rename(oldname, newname string) error
- func (kf *LkkFile) SafeFileName(str string) string
- func (kf *LkkFile) ShaX(fpath string, x uint16) (string, error)
- func (kf *LkkFile) TarGz(src string, dstTar string, ignorePatterns ...string) (bool, error)
- func (kf *LkkFile) Touch(fpath string, size int64) bool
- func (kf *LkkFile) UnTarGz(srcTar, dstDir string) (bool, error)
- func (kf *LkkFile) UnZip(srcZip, dstDir string) (bool, error)
- func (kf *LkkFile) Unlink(fpath string) error
- func (kf *LkkFile) WriteFile(fpath string, data []byte, perm ...os.FileMode) error
- func (kf *LkkFile) Zip(dst string, fpaths ...string) (bool, error)
- type LkkFileCover
- type LkkFileTree
- type LkkFileType
- type LkkNumber
- func (kn *LkkNumber) AbsFloat(number float64) float64
- func (kn *LkkNumber) AbsInt(number int64) int64
- func (kn *LkkNumber) Average(nums ...interface{}) (res float64)
- func (kn *LkkNumber) AverageFloat64(nums ...float64) (res float64)
- func (kn *LkkNumber) AverageInt(nums ...int) (res float64)
- func (kn *LkkNumber) ByteFormat(size float64, decimal uint8, delimiter string) string
- func (kn *LkkNumber) Ceil(value float64) float64
- func (kn *LkkNumber) Exp(x float64) float64
- func (kn *LkkNumber) Expm1(x float64) float64
- func (kn *LkkNumber) FloatEqual(f1 float64, f2 float64, decimal ...uint8) (res bool)
- func (kn *LkkNumber) Floor(value float64) float64
- func (kn *LkkNumber) GeoDistance(lng1, lat1, lng2, lat2 float64) float64
- func (kn *LkkNumber) InRange(value interface{}, left interface{}, right interface{}) bool
- func (kn *LkkNumber) InRangeFloat32(value, left, right float32) bool
- func (kn *LkkNumber) InRangeFloat64(value, left, right float64) bool
- func (kn *LkkNumber) InRangeInt(value, left, right int) bool
- func (kn *LkkNumber) IsEven(val int) bool
- func (kn *LkkNumber) IsNan(val interface{}) bool
- func (kn *LkkNumber) IsNatural(value float64) bool
- func (kn *LkkNumber) IsNaturalRange(arr []int, strict bool) (res bool)
- func (kn *LkkNumber) IsNegative(value float64) bool
- func (kn *LkkNumber) IsNonNegative(value float64) bool
- func (kn *LkkNumber) IsNonPositive(value float64) bool
- func (kn *LkkNumber) IsOdd(val int) bool
- func (kn *LkkNumber) IsPositive(value float64) bool
- func (kn *LkkNumber) IsWhole(value float64) bool
- func (kn *LkkNumber) Log(x, y float64) float64
- func (kn *LkkNumber) Max(nums ...interface{}) (res float64)
- func (kn *LkkNumber) MaxFloat64(nums ...float64) (res float64)
- func (kn *LkkNumber) MaxInt(nums ...int) (res int)
- func (kn *LkkNumber) Min(nums ...interface{}) (res float64)
- func (kn *LkkNumber) MinFloat64(nums ...float64) (res float64)
- func (kn *LkkNumber) MinInt(nums ...int) (res int)
- func (kn *LkkNumber) NearLogarithm(num, base int, left bool) int
- func (kn *LkkNumber) NumSign(value float64) (res int8)
- func (kn *LkkNumber) NumberFormat(number float64, decimal uint8, point, thousand string) string
- func (kn *LkkNumber) Percent(val, total interface{}) float64
- func (kn *LkkNumber) Pow(x, y float64) float64
- func (kn *LkkNumber) Rand(min, max int) int
- func (kn *LkkNumber) RandFloat64(min, max float64) float64
- func (kn *LkkNumber) RandInt(min, max int) int
- func (kn *LkkNumber) RandInt64(min, max int64) int64
- func (kn *LkkNumber) Range(start, end int) []int
- func (kn *LkkNumber) Round(value float64) float64
- func (kn *LkkNumber) RoundPlus(value float64, precision uint8) float64
- func (kn *LkkNumber) SplitNaturalNum(num, base int) []int
- func (kn *LkkNumber) Sum(nums ...interface{}) (res float64)
- func (kn *LkkNumber) SumFloat64(nums ...float64) float64
- func (kn *LkkNumber) SumInt(nums ...int) int
- type LkkOS
- func (ko *LkkOS) Chdir(dir string) error
- func (ko *LkkOS) Chmod(filename string, mode os.FileMode) bool
- func (ko *LkkOS) Chown(filename string, uid, gid int) bool
- func (ko *LkkOS) ClientIp(req *http.Request) string
- func (ko *LkkOS) CpuUsage() (user, idle, total uint64)
- func (ko *LkkOS) DiskUsage(path string) (used, free, total uint64)
- func (ko *LkkOS) Exec(command string) (retInt int, outStr, errStr []byte)
- func (ko *LkkOS) ForceGC()
- func (ko *LkkOS) GetBiosInfo() *BiosInfo
- func (ko *LkkOS) GetBoardInfo() *BoardInfo
- func (ko *LkkOS) GetCpuInfo() *CpuInfo
- func (ko *LkkOS) GetEndian() binary.ByteOrder
- func (ko *LkkOS) GetHostByIp(ipAddress string) (string, error)
- func (ko *LkkOS) GetIPs() (ips []string)
- func (ko *LkkOS) GetIpByHostname(hostname string) (string, error)
- func (ko *LkkOS) GetIpsByDomain(domain string) ([]string, error)
- func (ko *LkkOS) GetMacAddrs() (macAddrs []string)
- func (ko *LkkOS) GetPidByPort(port int) (pid int)
- func (ko *LkkOS) GetProcessExecPath(pid int) string
- func (ko *LkkOS) GetSystemInfo() *SystemInfo
- func (ko *LkkOS) GetTempDir() string
- func (ko *LkkOS) Getcwd() (string, error)
- func (ko *LkkOS) Getenv(varname string, defvalue ...string) string
- func (ko *LkkOS) GoMemory() uint64
- func (ko *LkkOS) HomeDir() (string, error)
- func (ko *LkkOS) Hostname() (string, error)
- func (ko *LkkOS) IsLinux() bool
- func (ko *LkkOS) IsLittleEndian() bool
- func (ko *LkkOS) IsMac() bool
- func (ko *LkkOS) IsPortOpen(host string, port interface{}, protocols ...string) bool
- func (ko *LkkOS) IsPrivateIp(str string) (bool, error)
- func (ko *LkkOS) IsProcessExists(pid int) (res bool)
- func (ko *LkkOS) IsPublicIP(str string) (bool, error)
- func (ko *LkkOS) IsWindows() bool
- func (ko *LkkOS) LocalIP() (string, error)
- func (ko *LkkOS) MemoryUsage(virtual bool) (used, free, total uint64)
- func (ko *LkkOS) OutboundIP() (string, error)
- func (ko *LkkOS) PrivateCIDR() []*net.IPNet
- func (ko *LkkOS) Pwd() string
- func (ko *LkkOS) Setenv(varname, data string) error
- func (ko *LkkOS) System(command string) (retInt int, outStr, errStr []byte)
- func (ko *LkkOS) TriggerGC()
- func (ko *LkkOS) Unsetenv(varname string) error
- func (ko *LkkOS) Uptime() (uint64, error)
- type LkkPKCSType
- type LkkPadType
- type LkkRandString
- type LkkString
- func (ks *LkkString) Addslashes(str string) string
- func (ks *LkkString) AtWho(text string, minLen ...int) []string
- func (ks *LkkString) Big5ToUtf8(s []byte) ([]byte, error)
- func (ks *LkkString) Br2nl(str string) string
- func (ks *LkkString) Chr(chr uint) string
- func (ks *LkkString) ChunkSplit(str string, chunklen uint, end string) string
- func (ks *LkkString) ClearUrlPrefix(str string, prefix ...string) string
- func (ks *LkkString) ClearUrlSuffix(str string, suffix ...string) string
- func (ks *LkkString) ClosestWord(word string, searchs []string) (string, int)
- func (ks *LkkString) CountBase64Byte(str string) (res int)
- func (ks *LkkString) CountWords(str string) (int, map[string]int)
- func (ks *LkkString) Crc32(str string) uint32
- func (ks *LkkString) DBC2SBC(s string) string
- func (ks *LkkString) DetectEncoding(str string) (res string)
- func (ks *LkkString) Dstrpos(str string, arr []string, chkCase bool) (bool, string)
- func (ks *LkkString) EndsWith(str, sub string, ignoreCase bool) bool
- func (ks *LkkString) EndsWiths(str string, subs []string, ignoreCase bool) (res bool)
- func (ks *LkkString) Explode(str string, delimiters ...string) (res []string)
- func (ks *LkkString) FirstLetter(str string) string
- func (ks *LkkString) FormatUrl(str string) string
- func (ks *LkkString) GbkToUtf8(s []byte) ([]byte, error)
- func (ks *LkkString) GetDomain(str string, isMain ...bool) string
- func (ks *LkkString) GetEquationValue(str, name string) (res string)
- func (ks *LkkString) Gravatar(email string, size uint16) string
- func (ks *LkkString) HasChinese(str string) bool
- func (ks *LkkString) HasEmoji(str string) bool
- func (ks *LkkString) HasEnglish(str string) bool
- func (ks *LkkString) HasFullWidth(str string) bool
- func (ks *LkkString) HasHalfWidth(str string) bool
- func (ks *LkkString) HasLetter(str string) bool
- func (ks *LkkString) HasSpecialChar(str string) bool
- func (ks *LkkString) HasWhitespace(str string) bool
- func (ks *LkkString) HideCard(card string) string
- func (ks *LkkString) HideMobile(mobile string) string
- func (ks *LkkString) HideTrueName(name string) string
- func (ks *LkkString) Html2Text(str string) string
- func (ks *LkkString) Htmlentities(str string) string
- func (ks *LkkString) HtmlentityDecode(str string) string
- func (ks *LkkString) HttpBuildQuery(queryData url.Values) string
- func (ks *LkkString) Img2Base64(content []byte, ext ...string) string
- func (ks *LkkString) Index(str, sub string, ignoreCase bool) int
- func (ks *LkkString) IsASCII(str string) bool
- func (ks *LkkString) IsAlphaNumeric(str string) bool
- func (ks *LkkString) IsBase64(str string) bool
- func (ks *LkkString) IsBase64Image(str string) bool
- func (ks *LkkString) IsBlank(str string) bool
- func (ks *LkkString) IsChinese(str string) bool
- func (ks *LkkString) IsChineseName(str string) bool
- func (ks *LkkString) IsCreditNo(str string) (bool, string)
- func (ks *LkkString) IsDNSName(str string) bool
- func (ks *LkkString) IsDialAddr(str string) bool
- func (ks *LkkString) IsEmail(email string, validateHost bool) (bool, error)
- func (ks *LkkString) IsEmpty(str string) bool
- func (ks *LkkString) IsEnglish(str string, letterCase LkkCaseSwitch) bool
- func (ks *LkkString) IsGbk(s []byte) (res bool)
- func (ks *LkkString) IsHexcolor(str string) (bool, string)
- func (ks *LkkString) IsHost(str string) bool
- func (ks *LkkString) IsIP(str string) bool
- func (ks *LkkString) IsIPv4(str string) bool
- func (ks *LkkString) IsIPv6(str string) bool
- func (ks *LkkString) IsJSON(str string) bool
- func (ks *LkkString) IsLetters(str string) bool
- func (ks *LkkString) IsLower(str string) bool
- func (ks *LkkString) IsMACAddr(str string) bool
- func (ks *LkkString) IsMd5(str string) bool
- func (ks *LkkString) IsMobilecn(str string) bool
- func (ks *LkkString) IsMultibyte(str string) bool
- func (ks *LkkString) IsNumeric(str string) bool
- func (ks *LkkString) IsPhone(str string) bool
- func (ks *LkkString) IsRGBcolor(str string) bool
- func (ks *LkkString) IsRsaPublicKey(str string, keylen uint16) bool
- func (ks *LkkString) IsSha1(str string) bool
- func (ks *LkkString) IsSha256(str string) bool
- func (ks *LkkString) IsSha512(str string) bool
- func (ks *LkkString) IsTel(str string) bool
- func (ks *LkkString) IsUpper(str string) bool
- func (ks *LkkString) IsUrl(str string) bool
- func (ks *LkkString) IsUrlExists(str string) bool
- func (ks *LkkString) IsUtf8(s []byte) bool
- func (ks *LkkString) IsWhitespaces(str string) bool
- func (ks *LkkString) IsWord(str string) bool
- func (ks *LkkString) JsonDecode(str []byte, res interface{}) error
- func (ks *LkkString) JsonEncode(val interface{}) ([]byte, error)
- func (ks *LkkString) Jsonp2Json(str string) (string, error)
- func (ks *LkkString) LastIndex(str, sub string, ignoreCase bool) int
- func (ks *LkkString) Lcfirst(str string) string
- func (ks *LkkString) Lcwords(str string) string
- func (ks *LkkString) Levenshtein(a, b string) int
- func (ks *LkkString) Ltrim(str string, characterMask ...string) string
- func (ks *LkkString) MatchEquations(str string) (res []string)
- func (ks *LkkString) MbStrlen(str string) int
- func (ks *LkkString) MbSubstr(str string, start int, length ...int) string
- func (ks *LkkString) Md5(str string, length ...uint8) string
- func (ks *LkkString) Md5Byte(str []byte, length ...uint8) []byte
- func (ks *LkkString) Nl2br(str string) string
- func (ks *LkkString) Ord(char string) rune
- func (ks *LkkString) ParseStr(encodedString string, result map[string]interface{}) error
- func (ks *LkkString) ParseUrl(str string, component int16) (map[string]string, error)
- func (ks *LkkString) Quotemeta(str string) string
- func (ks *LkkString) Random(length uint8, rtype LkkRandString) string
- func (ks *LkkString) RawUrlDecode(str string) (string, error)
- func (ks *LkkString) RawUrlEncode(str string) string
- func (ks *LkkString) RemoveAfter(str, after string, include, ignoreCase bool) string
- func (ks *LkkString) RemoveBefore(str, before string, include, ignoreCase bool) string
- func (ks *LkkString) RemoveEmoji(str string) string
- func (ks *LkkString) RemoveSpace(str string, all bool) string
- func (ks *LkkString) Reverse(str string) string
- func (ks *LkkString) Rtrim(str string, characterMask ...string) string
- func (ks *LkkString) SBC2DBC(s string) string
- func (ks *LkkString) Serialize(val interface{}) ([]byte, error)
- func (ks *LkkString) ShaX(str string, x uint16) string
- func (ks *LkkString) ShaXByte(str []byte, x uint16) []byte
- func (ks *LkkString) Shuffle(str string) string
- func (ks *LkkString) SimilarText(first, second string) (res int, percent float64)
- func (ks *LkkString) StartsWith(str, sub string, ignoreCase bool) bool
- func (ks *LkkString) StartsWiths(str string, subs []string, ignoreCase bool) (res bool)
- func (ks *LkkString) StripTags(str string) string
- func (ks *LkkString) Stripos(haystack, needle string, offset int) int
- func (ks *LkkString) Stripslashes(str string) string
- func (ks *LkkString) Strlen(str string) int
- func (ks *LkkString) Strpad(str string, fill string, max int, ptype LkkPadType) string
- func (ks *LkkString) StrpadBoth(str string, fill string, max int) string
- func (ks *LkkString) StrpadLeft(str string, fill string, max int) string
- func (ks *LkkString) StrpadRight(str string, fill string, max int) string
- func (ks *LkkString) Strpos(haystack, needle string, offset int) int
- func (ks *LkkString) Strripos(haystack, needle string, offset int) int
- func (ks *LkkString) Strrpos(haystack, needle string, offset int) int
- func (ks *LkkString) Substr(str string, start int, length ...int) string
- func (ks *LkkString) SubstrCount(str, substr string) int
- func (ks *LkkString) SubstriCount(str, substr string) int
- func (ks *LkkString) ToCamelCase(str string) string
- func (ks *LkkString) ToKebabCase(str string) string
- func (ks *LkkString) ToSnakeCase(str string) string
- func (ks *LkkString) Trim(str string, characterMask ...string) string
- func (ks *LkkString) TrimBOM(str []byte) []byte
- func (ks *LkkString) Ucfirst(str string) string
- func (ks *LkkString) Ucwords(str string) string
- func (ks *LkkString) UnSerialize(data []byte, register ...interface{}) (val interface{}, err error)
- func (ks *LkkString) Uniqid(prefix string) string
- func (ks *LkkString) UrlDecode(str string) (string, error)
- func (ks *LkkString) UrlEncode(str string) string
- func (ks *LkkString) Utf8ToBig5(s []byte) ([]byte, error)
- func (ks *LkkString) Utf8ToGbk(s []byte) ([]byte, error)
- func (ks *LkkString) UuidV4() (string, error)
- func (ks *LkkString) VersionCompare(version1, version2, operator string) (bool, error)
- type LkkTime
- func (kt *LkkTime) CheckDate(year, month, day int) bool
- func (kt *LkkTime) Date(format string, ts ...interface{}) string
- func (kt *LkkTime) Day(t ...time.Time) int
- func (kt *LkkTime) DaysBetween(fromDate, toDate time.Time) int
- func (kt *LkkTime) EndOfDay(date time.Time) time.Time
- func (kt *LkkTime) EndOfMonth(date time.Time) time.Time
- func (kt *LkkTime) EndOfWeek(date time.Time, weekStartDay ...time.Weekday) time.Time
- func (kt *LkkTime) EndOfYear(date time.Time) time.Time
- func (kt *LkkTime) GetMonthDays(month int, year ...int) (days int)
- func (kt *LkkTime) Hour(t ...time.Time) int
- func (kt *LkkTime) IsDate2time(str string) (bool, int64)
- func (kt *LkkTime) MicroTime() int64
- func (kt *LkkTime) MilliTime() int64
- func (kt *LkkTime) Minute(t ...time.Time) int
- func (kt *LkkTime) Month(t ...time.Time) int
- func (kt *LkkTime) Second(t ...time.Time) int
- func (kt *LkkTime) ServiceStartime() int64
- func (kt *LkkTime) ServiceUptime() time.Duration
- func (kt *LkkTime) Sleep(t int64)
- func (kt *LkkTime) StartOfDay(date time.Time) time.Time
- func (kt *LkkTime) StartOfMonth(date time.Time) time.Time
- func (kt *LkkTime) StartOfWeek(date time.Time, weekStartDay ...time.Weekday) time.Time
- func (kt *LkkTime) StartOfYear(date time.Time) time.Time
- func (kt *LkkTime) Str2Timestamp(str string, format ...string) (int64, error)
- func (kt *LkkTime) Str2Timestruct(str string, format ...string) (time.Time, error)
- func (kt *LkkTime) UnixTime() int64
- func (kt *LkkTime) Usleep(t int64)
- func (kt *LkkTime) Year(t ...time.Time) int
- type SystemInfo
Constants ¶
const ( // Version 版本号 Version = "0.1.9" Unknown = "Unknown" //UINT_MAX 无符号整型uint最大值 UINT_MAX = ^uint(0) //UINT8_MAX 无符号整型uint8最大值, 255 UINT8_MAX = ^uint8(0) //UINT16_MAX 无符号整型uint16最大值, 65535 UINT16_MAX = ^uint16(0) //UINT32_MAX 无符号整型uint32最大值, 4294967295 UINT32_MAX = ^uint32(0) //UINT64_MAX 无符号整型uint64最大值, 18446744073709551615 UINT64_MAX = ^uint64(0) //INT_MAX 有符号整型int最大值 INT_MAX = int(^uint(0) >> 1) //INT_MIN 有符号整型int最小值 INT_MIN = ^INT_MAX //INT32_MAX 有符号整型int32最大值, 2147483647 INT32_MAX = int32(^uint32(0) >> 1) //INT32_MIN 有符号整型int32最小值, -2147483648 INT32_MIN = ^INT32_MAX //INT64_MAX 有符号整型int64最大值, 9223372036854775807 INT64_MAX = int64(^uint64(0) >> 1) //INT64_MIN 有符号整型int64最小值, -9223372036854775808 INT64_MIN = ^INT64_MAX // FILE_COVER_ALLOW 文件覆盖,允许 FILE_COVER_ALLOW LkkFileCover = 1 // FILE_COVER_IGNORE 文件覆盖,忽略 FILE_COVER_IGNORE LkkFileCover = 0 // FILE_COVER_DENY 文件覆盖,禁止 FILE_COVER_DENY LkkFileCover = -1 // FILE_TYPE_ANY 文件类型-任意 FILE_TYPE_ANY LkkFileType = 0 // FILE_TYPE_LINK 文件类型-链接文件 FILE_TYPE_LINK LkkFileType = 1 // FILE_TYPE_REGULAR 文件类型-常规文件(不包括链接) FILE_TYPE_REGULAR LkkFileType = 2 // FILE_TYPE_COMMON 文件类型-普通文件(包括常规和链接) FILE_TYPE_COMMON LkkFileType = 3 // FILE_TREE_ALL 文件树,查找所有(包括目录和文件) FILE_TREE_ALL LkkFileTree = 3 // FILE_TREE_DIR 文件树,仅查找目录 FILE_TREE_DIR LkkFileTree = 2 // FILE_TREE_FILE 文件树,仅查找文件 FILE_TREE_FILE LkkFileTree = 1 // RAND_STRING_ALPHA 随机字符串类型,字母 RAND_STRING_ALPHA LkkRandString = 0 // RAND_STRING_NUMERIC 随机字符串类型,数值 RAND_STRING_NUMERIC LkkRandString = 1 // RAND_STRING_ALPHANUM 随机字符串类型,字母+数值 RAND_STRING_ALPHANUM LkkRandString = 2 // RAND_STRING_SPECIAL 随机字符串类型,字母+数值+特殊字符 RAND_STRING_SPECIAL LkkRandString = 3 // RAND_STRING_CHINESE 随机字符串类型,仅中文 RAND_STRING_CHINESE LkkRandString = 4 // CASE_NONE 忽略大小写 CASE_NONE LkkCaseSwitch = 0 // CASE_LOWER 检查小写 CASE_LOWER LkkCaseSwitch = 1 // CASE_UPPER 检查大写 CASE_UPPER LkkCaseSwitch = 2 // PAD_LEFT 左侧填充 PAD_LEFT LkkPadType = 0 // PAD_RIGHT 右侧填充 PAD_RIGHT LkkPadType = 1 // PAD_BOTH 两侧填充 PAD_BOTH LkkPadType = 2 // PKCS_NONE 不进行填充 PKCS_NONE LkkPKCSType = -1 // PKCS_ZERO PKCS 0值填充 PKCS_ZERO LkkPKCSType = 0 // PKCS_SEVEN 即PKCS7 PKCS_SEVEN LkkPKCSType = 7 // COMPARE_ONLY_VALUE 仅比较值 COMPARE_ONLY_VALUE LkkArrCompareType = 0 // COMPARE_ONLY_KEY 仅比较键 COMPARE_ONLY_KEY LkkArrCompareType = 1 // COMPARE_BOTH_KEYVALUE 同时比较键和值 COMPARE_BOTH_KEYVALUE LkkArrCompareType = 2 //默认浮点数精确小数位数 FLOAT_DECIMAL uint8 = 8 //AuthCode 动态密钥长度,须<32 DYNAMIC_KEY_LEN = 8 //检查连接超时的时间 CHECK_CONNECT_TIMEOUT = time.Second * 5 // 正则模式-全中文 PATTERN_CHINESE_ALL = "^[\u4e00-\u9fa5]+$" // 正则模式-中文名称 PATTERN_CHINESE_NAME = "^[\u4e00-\u9fa5][.•·\u4e00-\u9fa5]{0,30}[\u4e00-\u9fa5]$" // 正则模式-多字节字符 PATTERN_MULTIBYTE = "[^\x00-\x7F]" // 正则模式-ASCII字符 PATTERN_ASCII = "^[\x00-\x7F]+$" // 正则模式-全角字符 PATTERN_FULLWIDTH = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" // 正则模式-半角字符 PATTERN_HALFWIDTH = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" // 正则模式-词语,不以下划线开头的中文、英文、数字、下划线 PATTERN_WORD = "^[a-zA-Z0-9\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]+$" // 正则模式-浮点数 PATTERN_FLOAT = `^(-?\d+)(\.\d+)` // 正则模式-邮箱 PATTERN_EMAIL = "" /* 133-byte string literal not displayed */ // 正则模式-用户名-英文 PATTERN_USERNAMEEN = `^[a-zA-Z0-9_.]+$` // 正则模式-大陆手机号 PATTERN_MOBILECN = `^1[3-9]\d{9}$` // 正则模式-固定电话 PATTERN_TEL_FIX = `^(010|02\d{1}|0[3-9]\d{2})-\d{7,9}(-\d+)?$` // 正则模式-400或800 PATTERN_TEL_4800 = `^[48]00\d?(-?\d{3,4}){2}$` // 正则模式-座机号(固定电话或400或800) PATTERN_TELEPHONE = `(` + PATTERN_TEL_FIX + `)|(` + PATTERN_TEL_4800 + `)` // 正则模式-电话(手机或固话) PATTERN_PHONE = `(` + PATTERN_MOBILECN + `)|(` + PATTERN_TEL_FIX + `)` // 正则模式-日期时间 PATTERN_DATETIME = `^[0-9]{4}(|\-[0-9]{2}(|\-[0-9]{2}(|\s+[0-9]{2}(|:[0-9]{2}(|:[0-9]{2})))))$` // 正则模式-身份证号码,18位或15位 PATTERN_CREDIT_NO = `` /* 158-byte string literal not displayed */ // 正则模式-小写英文 PATTERN_ALPHA_LOWER = `^[a-z]+$` // 正则模式-大写英文 PATTERN_ALPHA_UPPER = `^[A-Z]+$` // 正则模式-字母或数字 PATTERN_ALPHA_NUMERIC = `^[a-zA-Z0-9]+$` // 正则模式-十六进制颜色 PATTERN_HEXCOLOR = `^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$` // 正则模式-RGB颜色 PATTERN_RGBCOLOR = "" /* 157-byte string literal not displayed */ // 正则模式-全空白字符 PATTERN_WHITESPACE_ALL = "^[[:space:]]+$" // 正则模式-带空白字符 PATTERN_WHITESPACE_HAS = ".*[[:space:]]" // 正则模式-连续空白符 PATTERN_WHITESPACE_DUPLICATE = `[[:space:]]{2,}|[\s\p{Zs}]{2,}` // 正则模式-base64字符串 PATTERN_BASE64 = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" // 正则模式-base64编码图片 PATTERN_BASE64_IMAGE = `^data:\s*(image|img)\/(\w+);base64` // 正则模式-html标签 PATTERN_HTML_TAGS = `<(.|\n)*?>` // 正则模式-DNS名称 PATTERN_DNSNAME = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` // 正则模式-MD5 PATTERN_MD5 = `^(?i)([0-9a-h]{32})$` // 正则模式-SHA1 PATTERN_SHA1 = `^(?i)([0-9a-h]{40})$` // 正则模式-SHA256 PATTERN_SHA256 = `^(?i)([0-9a-h]{64})$` // 正则模式-SHA512 PATTERN_SHA512 = `^(?i)([0-9a-h]{128})$` //正则模式-等式 x = y PATTERN_EQUATION = `['"]?([\w\-]+)['"]?[\s]*=[\s]*['"]?(.*)['"]?` // 正则模式-emoji表情符 PATTERN_EMOJI = `` /* 21966-byte string literal not displayed */ )
Variables ¶
var ( // Kuptime 当前服务启动时间 Kuptime = time.Now() // KFile utilities KFile LkkFile // KStr utilities KStr LkkString // KNum utilities KNum LkkNumber // KArr utilities KArr LkkArray // KTime utilities KTime LkkTime // KConv utilities KConv LkkConvert // KOS utilities KOS LkkOS // KEncr utilities KEncr LkkEncrypt // KDbug utilities KDbug LkkDebug // KPrivCidrs 私有网段的CIDR数组 KPrivCidrs []*net.IPNet // KDelimiter 本库自定义分隔符 KDelimiter = "$@#KSYS#@$" // 身份证区域 CreditArea = map[string]string{"11": "北京", "12": "天津", "13": "河北", "14": "山西", "15": "内蒙古", "21": "辽宁", "22": "吉林", "23": "黑龙江", " 31": "上海", "32": "江苏", "33": "浙江", "34": "安徽", "35": "福建", "36": "江西", "37": "山东", "41": "河南", "42": "湖北", "43": "湖南", "44": "广东", "45": "广西", "46": "海南", "50": "重庆", "51": "四川", "52": "贵州", "53": "云南", "54": "西藏", "61": "陕西", "62": "甘肃", "63": "青海", "64": "宁夏", "65": "新疆", "71": "台湾", "81": "香港", "82": "澳门", "91": "国外"} // 常用中文字符集 CommonChinese = []rune("们以我到他会作时要动国产的一是工就年阶义发成部民可出能方进在了不和有大这主中人上为来分生对于学下级地个用同行面说种过命度革而多子后自社加小机也经力线本电高量长党得实家定深法表着水理化争现所二起政三好十战无农使性前等反体合斗路图把结第里正新开论之物从当两些还天资事队批点育重其思与间内去因件日利相由压员气业代全组数果期导平各基或月毛然如应形想制心样干都向变关问比展那它最及外没看治提五解系林者米群头意只明四道马认次文通但条较克又公孔领军流入接席位情运器并飞原油放立题质指建区验活众很教决特此常石强极土少已根共直团统式转别造切九你取西持总料连任志观调七么山程百报更见必真保热委手改管处己将修支识病象几先老光专什六型具示复安带每东增则完风回南广劳轮科北打积车计给节做务被整联步类集号列温装即毫知轴研单色坚据速防史拉世设达尔场织历花受求传口断况采精金界品判参层止边清至万确究书术状厂须离再目海交权且儿青才证低越际八试规斯近注办布门铁需走议县兵固除般引齿千胜细影济白格效置推空配刀叶率述今选养德话查差半敌始片施响收华觉备名红续均药标记难存测士身紧液派准斤角降维板许破述技消底床田势端感往神便贺村构照容非搞亚磨族火段算适讲按值美态黄易彪服早班麦削信排台声该击素张密害侯草何树肥继右属市严径螺检左页抗苏显苦英快称坏移约巴材省黑武培著河帝仅针怎植京助升王眼她抓含苗副杂普谈围食射源例致酸旧却充足短划剂宣环落首尺波承粉践府鱼随考刻靠够满夫失包住促枝局菌杆周护岩师举曲春元超负砂封换太模贫减阳扬江析亩木言球朝医校古呢稻宋听唯输滑站另卫字鼓刚写刘微略范供阿块某功套友限项余倒卷创律雨让骨远帮初皮播优占死毒圈伟季训控激找叫云互跟裂粮粒母练塞钢顶策双留误础吸阻故寸盾晚丝女散焊功株亲院冷彻弹错散商视艺灭版烈零室轻血倍缺厘泵察绝富城冲喷壤简否柱李望盘磁雄似困巩益洲脱投送奴侧润盖挥距触星松送获兴独官混纪依未突架宽冬章湿偏纹吃执阀矿寨责熟稳夺硬价努翻奇甲预职评读背协损棉侵灰虽矛厚罗泥辟告卵箱掌氧恩爱停曾溶营终纲孟钱待尽俄缩沙退陈讨奋械载胞幼哪剥迫旋征槽倒握担仍呀鲜吧卡粗介钻逐弱脚怕盐末阴丰雾冠丙街莱贝辐肠付吉渗瑞惊顿挤秒悬姆烂森糖圣凹陶词迟蚕亿矩康遵牧遭幅园腔订香肉弟屋敏恢忘编印蜂急拿扩伤飞露核缘游振操央伍域甚迅辉异序免纸夜乡久隶缸夹念兰映沟乙吗儒杀汽磷艰晶插埃燃欢铁补咱芽永瓦倾阵碳演威附牙芽永瓦斜灌欧献顺猪洋腐请透司危括脉宜笑若尾束壮暴企菜穗楚汉愈绿拖牛份染既秋遍锻玉夏疗尖殖井费州访吹荣铜沿替滚客召旱悟刺脑措贯藏敢令隙炉壳硫煤迎铸粘探临薄旬善福纵择礼愿伏残雷延烟句纯渐耕跑泽慢栽鲁赤繁境潮横掉锥希池败船假亮谓托伙哲怀割摆贡呈劲财仪沉炼麻罪祖息车穿货销齐鼠抽画饲龙库守筑房歌寒喜哥洗蚀废纳腹乎录镜妇恶脂庄擦险赞钟摇典柄辩竹谷卖乱虚桥奥伯赶垂途额壁网截野遗静谋弄挂课镇妄盛耐援扎虑键归符庆聚绕摩忙舞遇索顾胶羊湖钉仁音迹碎伸灯避泛亡答勇频皇柳哈揭甘诺概宪浓岛袭谁洪谢炮浇斑讯懂灵蛋闭孩释乳巨徒私银伊景坦累匀霉杜乐勒隔弯绩招绍胡呼痛峰零柴簧午跳居尚丁秦稍追梁折耗碱殊岗挖氏刃剧堆赫荷胸衡勤膜篇登驻案刊秧缓凸役剪川雪链渔啦脸户洛孢勃盟买杨宗焦赛旗滤硅炭股坐蒸凝竟陷枪黎救冒暗洞犯筒您宋弧爆谬涂味津臂障褐陆啊健尊豆拔莫抵桑坡缝警挑污冰柬嘴啥饭塑寄赵喊垫丹渡耳刨虎笔稀昆浪萨茶滴浅拥穴覆伦娘吨浸袖珠雌妈紫戏塔锤震岁貌洁剖牢锋疑霸闪埔猛诉刷狠忽灾闹乔唐漏闻沈熔氯荒茎男凡抢像浆旁玻亦忠唱蒙予纷捕锁尤乘乌智淡允叛畜俘摸锈扫毕璃宝芯爷鉴秘净蒋钙肩腾枯抛轨堂拌爸循诱祝励肯酒绳穷塘燥泡袋朗喂铝软渠颗惯贸粪综墙趋彼届墨碍启逆卸航衣孙龄岭骗休借") // html抽取文本要排除的标签 TextHtmlExcludeTags = []string{"head", "title", "img", "form", "textarea", "input", "select", "button", "iframe", "script", "style", "option"} // 已编译的正则 RegFormatDir = regexp.MustCompile(`[\/]{2,}`) //连续的"//"或"\\"或"\/"或"/\" RegChineseAll = regexp.MustCompile(PATTERN_CHINESE_ALL) RegChineseName = regexp.MustCompile(PATTERN_CHINESE_NAME) RegWord = regexp.MustCompile(PATTERN_WORD) RegMultiByte = regexp.MustCompile(PATTERN_MULTIBYTE) RegFullWidth = regexp.MustCompile(PATTERN_FULLWIDTH) RegHalfWidth = regexp.MustCompile(PATTERN_HALFWIDTH) RegFloat = regexp.MustCompile(PATTERN_FLOAT) RegEmail = regexp.MustCompile(PATTERN_EMAIL) RegMobilecn = regexp.MustCompile(PATTERN_MOBILECN) RegTelephone = regexp.MustCompile(PATTERN_TELEPHONE) RegPhone = regexp.MustCompile(PATTERN_PHONE) RegDatetime = regexp.MustCompile(PATTERN_DATETIME) RegCreditno = regexp.MustCompile(PATTERN_CREDIT_NO) RegAlphaLower = regexp.MustCompile(PATTERN_ALPHA_LOWER) RegAlphaUpper = regexp.MustCompile(PATTERN_ALPHA_UPPER) RegAlphaNumeric = regexp.MustCompile(PATTERN_ALPHA_NUMERIC) RegHexcolor = regexp.MustCompile(PATTERN_HEXCOLOR) RegRgbcolor = regexp.MustCompile(PATTERN_RGBCOLOR) RegWhitespace = regexp.MustCompile(`\s`) RegWhitespaceAll = regexp.MustCompile(PATTERN_WHITESPACE_ALL) RegWhitespaceHas = regexp.MustCompile(PATTERN_WHITESPACE_HAS) RegWhitespaceDuplicate = regexp.MustCompile(PATTERN_WHITESPACE_DUPLICATE) RegBase64 = regexp.MustCompile(PATTERN_BASE64) RegBase64Image = regexp.MustCompile(PATTERN_BASE64_IMAGE) RegHtmlTag = regexp.MustCompile(PATTERN_HTML_TAGS) RegDNSname = regexp.MustCompile(PATTERN_DNSNAME) RegUrlBackslashDuplicate = regexp.MustCompile(`([^:])[\/]{2,}`) //url中连续的"//"或"\\"或"\/"或"/\" RegMd5 = regexp.MustCompile(PATTERN_MD5) RegSha1 = regexp.MustCompile(PATTERN_SHA1) RegSha256 = regexp.MustCompile(PATTERN_SHA256) RegSha512 = regexp.MustCompile(PATTERN_SHA512) RegEmoji = regexp.MustCompile(PATTERN_EMOJI) RegUsernameen = regexp.MustCompile(PATTERN_USERNAMEEN) RegEquation = regexp.MustCompile(PATTERN_EQUATION) )
Functions ¶
func CallFunc ¶
func CallFunc(f interface{}, args ...interface{}) (results []interface{}, err error)
CallFunc 动态调用函数.
func GetFieldValue ¶
GetFieldValue 获取(字典/结构体的)字段值;fieldName为字段名,大小写敏感.
func GetVariatePointerAddr ¶
func GetVariatePointerAddr(val interface{}) int64
GetVariatePointerAddr 获取变量的指针地址.
Types ¶
type BiosInfo ¶
type BiosInfo struct { Vendor string `json:"vendor"` Version string `json:"version"` Date string `json:"date"` }
BiosInfo BIOS信息
type BoardInfo ¶
type BoardInfo struct { Name string `json:"name"` Vendor string `json:"vendor"` Version string `json:"version"` Serial string `json:"serial"` AssetTag string `json:"assettag"` }
BoardInfo Board信息
type CpuInfo ¶
type CpuInfo struct { Vendor string `json:"vendor"` Model string `json:"model"` Speed string `json:"speed"` // CPU clock rate in MHz Cache uint `json:"cache"` // CPU cache size in KB Cpus uint `json:"cpus"` // number of physical CPUs Cores uint `json:"cores"` // number of physical CPU cores Threads uint `json:"threads"` // number of logical (HT) CPU cores }
CpuInfo CPU信息
type LkkArray ¶
type LkkArray struct { }
LkkArray is the receiver of array utilities
func (*LkkArray) ArrayChunk ¶
ArrayChunk 将一个数组/切片分割成多个,size为每个子数组的长度.
func (*LkkArray) ArrayColumn ¶
ArrayColumn 返回数组(切片/字典/结构体)中元素指定的一列. arr的元素必须是字典; columnKey为元素的字段名; 该方法效率较低.
func (*LkkArray) ArrayDiff ¶
func (ka *LkkArray) ArrayDiff(arr1, arr2 interface{}, compareType LkkArrCompareType) map[interface{}]interface{}
ArrayDiff 计算数组(数组/切片/字典)的交集,返回在 arr1 中但不在 arr2 里的元素,注意会同时返回键. compareType为两个数组的比较方式,枚举类型,有: COMPARE_ONLY_VALUE 根据元素值比较, 返回在 arr1 中但是不在arr2 里的值; COMPARE_ONLY_KEY 根据 arr1 中的键名和 arr2 进行比较,返回不同键名的项; COMPARE_BOTH_KEYVALUE 同时比较键和值.
func (*LkkArray) ArrayFlip ¶
func (ka *LkkArray) ArrayFlip(arr interface{}) map[interface{}]interface{}
ArrayFlip 交换数组(切片/字典)中的键和值.
func (*LkkArray) ArrayIntersect ¶
func (ka *LkkArray) ArrayIntersect(arr1, arr2 interface{}, compareType LkkArrCompareType) map[interface{}]interface{}
ArrayIntersect 计算数组(数组/切片/字典)的交集,返回在 arr1 中且在 arr2 里的元素,注意会同时返回键. compareType为两个数组的比较方式,枚举类型,有: COMPARE_ONLY_VALUE 根据元素值比较, 返回在 arr1 中且在arr2 里的值; COMPARE_ONLY_KEY 根据 arr1 中的键名和 arr2 进行比较,返回相同键名的项; COMPARE_BOTH_KEYVALUE 同时比较键和值.
func (*LkkArray) ArrayKeyExists ¶
ArrayKeyExists 检查arr(数组/切片/字典/结构体)里是否有key指定的键名(索引/字段).
func (*LkkArray) ArrayKeys ¶
func (ka *LkkArray) ArrayKeys(arr interface{}) []interface{}
ArrayKeys 返回数组(切片/字典/结构体)中所有的键名;如果是结构体,只返回公开的字段.
func (*LkkArray) ArrayPad ¶
ArrayPad 以指定长度将一个值item填充进arr数组/切片. 若 size 为正,则填补到数组的右侧,如果为负则从左侧开始填补; 若 size 的绝对值小于或等于 arr 数组的长度则没有任何填补.
func (*LkkArray) ArrayReverse ¶
func (ka *LkkArray) ArrayReverse(arr interface{}) []interface{}
ArrayReverse 返回单元顺序相反的数组(仅限数组和切片).
func (*LkkArray) ArraySearchItem ¶
func (ka *LkkArray) ArraySearchItem(arr interface{}, condition map[string]interface{}) (res interface{})
ArraySearchItem 从数组(切片/字典)中搜索对应元素(单个). arr为要查找的数组,元素必须为字典/结构体;condition为条件字典.
func (*LkkArray) ArraySearchMutil ¶
func (ka *LkkArray) ArraySearchMutil(arr interface{}, condition map[string]interface{}) (res []interface{})
ArraySearchMutil 从数组(切片/字典)中搜索对应元素(多个). arr为要查找的数组,元素必须为字典/结构体;condition为条件字典.
func (*LkkArray) ArrayShuffle ¶
func (ka *LkkArray) ArrayShuffle(arr interface{}) []interface{}
ArrayShuffle 打乱数组/切片排序.
func (*LkkArray) ArrayUnique ¶
func (ka *LkkArray) ArrayUnique(arr interface{}) map[interface{}]interface{}
ArrayUnique 移除数组(切片/字典)中重复的值,返回字典,保留键名.
func (*LkkArray) ArrayValues ¶
ArrayValues 返回arr(数组/切片/字典/结构体)中所有的值;如果是结构体,只返回公开字段的值. filterZero 是否过滤零值元素(nil,false,0,"",[]),true时排除零值元素,false时保留零值元素.
func (*LkkArray) DeleteSliceItems ¶
DeleteSliceItems 删除数组/切片的元素,返回一个新切片. ids为多个元素的索引(0~len(val)-1); del为删除元素的数量.
func (*LkkArray) InInt64Slice ¶
InInt64Slice 是否在64位整型切片内.
func (*LkkArray) InIntSlice ¶
InIntSlice 是否在整型切片内.
func (*LkkArray) InStringSlice ¶
InStringSlice 是否在字符串切片内.
func (*LkkArray) IsArrayOrSlice ¶
IsArrayOrSlice 变量是否数组或切片.
func (*LkkArray) IsEqualArray ¶
IsEqualArray 两个数组/切片是否相同(不管元素顺序),且不会检查元素类型; arr1, arr2 是要比较的数组/切片.
func (*LkkArray) IsEqualMap ¶
IsEqualMap 两个字典是否相同(不管键顺序),且不会严格检查元素类型; arr1, arr2 是要比较的字典.
func (*LkkArray) JoinStrings ¶
JoinStrings 使用分隔符delimiter连接字符串切片strs.效率比Implode高.
func (*LkkArray) MergeMap ¶
func (ka *LkkArray) MergeMap(ss ...interface{}) map[interface{}]interface{}
MergeMap 合并字典,相同的键名时,后面的值将覆盖前一个值. ss是元素为字典的切片.
func (*LkkArray) MergeSlice ¶
MergeSlice 合并一个或多个数组/切片. filterZero 是否过滤零值元素(nil,false,0,”,[]),true时排除零值元素,false时保留零值元素. ss是元素为数组/切片的切片.
func (*LkkArray) NewStrMapItf ¶
NewStrMapItf 新建[字符-接口]字典.
func (*LkkArray) NewStrMapStr ¶
NewStrMapStr 新建[字符-字符]字典.
func (*LkkArray) SlicePop ¶
func (ka *LkkArray) SlicePop(s *[]interface{}) interface{}
SlicePop 弹出切片最后一个元素(出栈),并返回该元素.
func (*LkkArray) SliceShift ¶
func (ka *LkkArray) SliceShift(s *[]interface{}) interface{}
SliceShift 将切片开头的元素移出,并返回该元素.
func (*LkkArray) SliceUnshift ¶
SliceUnshift 在切片开头插入一个或多个元素,返回处理之后切片的元素个数.
func (*LkkArray) Unique64Ints ¶
Unique64Ints 移除64位整数切片中的重复值.
func (*LkkArray) UniqueInts ¶
UniqueInts 移除整数切片中的重复值.
func (*LkkArray) UniqueStrings ¶
UniqueStrings 移除字符串切片中的重复值.
type LkkConvert ¶
type LkkConvert struct { }
LkkConvert is the receiver of convert utilities
func (*LkkConvert) BaseConvert ¶
func (kc *LkkConvert) BaseConvert(num string, frombase, tobase int) (string, error)
BaseConvert 进制转换,在任意进制之间转换数字. num为输入数值,frombase为原进制,tobase为结果进制.
func (*LkkConvert) Bin2Dec ¶
func (kc *LkkConvert) Bin2Dec(str string) (int64, error)
Bin2Dec 将二进制字符串转换为十进制.
func (*LkkConvert) Bin2Hex ¶
func (kc *LkkConvert) Bin2Hex(str string) (string, error)
Bin2Hex 将二进制字符串转换为十六进制字符串.
func (*LkkConvert) Byte2Float64 ¶
func (kc *LkkConvert) Byte2Float64(bytes []byte) float64
Byte2Float64 字节切片转64位浮点数.
func (*LkkConvert) Byte2Hex ¶
func (kc *LkkConvert) Byte2Hex(val []byte) string
Byte2Hex 字节切片转16进制字符串.
func (*LkkConvert) Byte2Hexs ¶
func (kc *LkkConvert) Byte2Hexs(val []byte) []byte
Byte2Hexs 字节切片转16进制切片.
func (*LkkConvert) Byte2Int64 ¶
func (kc *LkkConvert) Byte2Int64(val []byte) int64
Byte2Int64 字节切片转64位整型.
func (*LkkConvert) Bytes2Str ¶
func (kc *LkkConvert) Bytes2Str(val []byte) string
Bytes2Str 将字节切片转换为字符串.
func (*LkkConvert) Bytes2StrUnsafe ¶
func (kc *LkkConvert) Bytes2StrUnsafe(val []byte) string
Bytes2StrUnsafe (非安全的)将字节切片转换为字符串. 零拷贝,不安全.效率是string([]byte{})的百倍以上,且转换量越大效率优势越明显.
func (*LkkConvert) Float2Str ¶
func (kc *LkkConvert) Float2Str(val interface{}, decimal int) string
Float2Str 将浮点数转换为字符串,decimal为小数位数.
func (*LkkConvert) Float64ToByte ¶
func (kc *LkkConvert) Float64ToByte(val float64) []byte
Float64ToByte 64位浮点数转字节切片.
func (*LkkConvert) Hex2Bin ¶
func (kc *LkkConvert) Hex2Bin(str string) (string, error)
Hex2Bin 将十六进制字符串转换为二进制字符串.
func (*LkkConvert) Hex2Byte ¶
func (kc *LkkConvert) Hex2Byte(str string) []byte
Hex2Byte 16进制字符串转字节切片.
func (*LkkConvert) Hex2Dec ¶
func (kc *LkkConvert) Hex2Dec(str string) (int64, error)
Hex2Dec 将十六进制转换为十进制.
func (*LkkConvert) Hexs2Byte ¶
func (kc *LkkConvert) Hexs2Byte(val []byte) []byte
Hexs2Byte 16进制切片转byte切片.
func (*LkkConvert) Int2Str ¶
func (kc *LkkConvert) Int2Str(val interface{}) string
Int2Str 将整数转换为字符串.
func (*LkkConvert) Int64ToByte ¶
func (kc *LkkConvert) Int64ToByte(val int64) []byte
Int64ToByte 64位整型转字节切片.
func (*LkkConvert) Ip2Long ¶
func (kc *LkkConvert) Ip2Long(ipAddress string) uint32
Ip2Long 将 IPV4 的字符串互联网协议转换成长整型数字.
func (*LkkConvert) IsInterface ¶
func (kc *LkkConvert) IsInterface(val interface{}) bool
IsInterface 变量是否接口.
func (*LkkConvert) IsNumeric ¶
func (kc *LkkConvert) IsNumeric(val interface{}) bool
IsNumeric 变量是否数值(不包含复数和科学计数法).
func (*LkkConvert) IsPort ¶
func (kc *LkkConvert) IsPort(val interface{}) bool
IsPort 变量值是否端口号(1~65535).
func (*LkkConvert) IsString ¶
func (kc *LkkConvert) IsString(val interface{}) bool
IsString 变量是否字符串.
func (*LkkConvert) IsStruct ¶
func (kc *LkkConvert) IsStruct(val interface{}) bool
IsStruct 变量是否结构体.
func (*LkkConvert) Long2Ip ¶
func (kc *LkkConvert) Long2Ip(properAddress uint32) string
Long2Ip 将长整型转化为字符串形式带点的互联网标准格式地址(IPV4).
func (*LkkConvert) Oct2Dec ¶
func (kc *LkkConvert) Oct2Dec(str string) (int64, error)
Oct2Dec 将八进制转换为十进制.
func (*LkkConvert) Runes2Bytes ¶
func (kc *LkkConvert) Runes2Bytes(rs []rune) []byte
Runes2Bytes 将[]rune转为[]byte.
func (*LkkConvert) Str2Bool ¶
func (kc *LkkConvert) Str2Bool(val string) bool
Str2Bool 将字符串转换为布尔值. 1, t, T, TRUE, true, True 等字符串为真; 0, f, F, FALSE, false, False 等字符串为假.
func (*LkkConvert) Str2Bytes ¶
func (kc *LkkConvert) Str2Bytes(val string) []byte
Str2Bytes 将字符串转换为字节切片.
func (*LkkConvert) Str2BytesUnsafe ¶
func (kc *LkkConvert) Str2BytesUnsafe(val string) []byte
Str2BytesUnsafe (非安全的)将字符串转换为字节切片. 该方法零拷贝,但不安全.它直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变. 仅当临时需将长字符串转换且不长时间保存时可以使用. 转换之后若没做其他操作直接改变里面的字符,则程序会崩溃. 如 b:=Str2BytesUnsafe("xxx"); b[1]='d'; 程序将panic.
func (*LkkConvert) Str2Float32 ¶
func (kc *LkkConvert) Str2Float32(val string) float32
Str2Float32 将字符串转换为float32;其中"true", "TRUE", "True"为1.0 .
func (*LkkConvert) Str2Float64 ¶
func (kc *LkkConvert) Str2Float64(val string) float64
Str2Float64 将字符串转换为float64;其中"true", "TRUE", "True"为1.0 .
func (*LkkConvert) Str2Int ¶
func (kc *LkkConvert) Str2Int(val string) int
Str2Int 将字符串转换为int.其中"true", "TRUE", "True"为1;若为浮点字符串,则取整数部分.
func (*LkkConvert) Str2Int16 ¶
func (kc *LkkConvert) Str2Int16(val string) int16
Str2Int16 将字符串转换为int16.
func (*LkkConvert) Str2Int32 ¶
func (kc *LkkConvert) Str2Int32(val string) int32
Str2Int32 将字符串转换为int32.
func (*LkkConvert) Str2Int64 ¶
func (kc *LkkConvert) Str2Int64(val string) int64
Str2Int64 将字符串转换为int64.
func (*LkkConvert) Str2Uint ¶
func (kc *LkkConvert) Str2Uint(val string) uint
Str2Uint 将字符串转换为uint.其中"true", "TRUE", "True"为1;若为浮点字符串,则取整数部分;若为负值则取0.
func (*LkkConvert) Str2Uint16 ¶
func (kc *LkkConvert) Str2Uint16(val string) uint16
Str2Uint16 将字符串转换为uint16.
func (*LkkConvert) Str2Uint32 ¶
func (kc *LkkConvert) Str2Uint32(val string) uint32
Str2Uint32 将字符串转换为uint32.
func (*LkkConvert) Str2Uint64 ¶
func (kc *LkkConvert) Str2Uint64(val string) uint64
Str2Uint64 将字符串转换为uint64.
func (*LkkConvert) Str2Uint8 ¶
func (kc *LkkConvert) Str2Uint8(val string) uint8
Str2Uint8 将字符串转换为uint8.
func (*LkkConvert) Struct2Map ¶
func (kc *LkkConvert) Struct2Map(obj interface{}, tagName string) (map[string]interface{}, error)
Struct2Map 结构体转为字典;tagName为要导出的标签名,可以为空,为空时将导出所有字段.
func (*LkkConvert) ToBool ¶
func (kc *LkkConvert) ToBool(val interface{}) bool
ToBool 强制将变量转换为布尔值. 数值类型将检查值是否>0; 字符串将使用Str2Bool; 数组、切片、字典、通道类型将检查它们的长度是否>0; 指针、结构体类型为true,其他为false.
func (*LkkConvert) ToFloat ¶
func (kc *LkkConvert) ToFloat(val interface{}) (res float64)
ToFloat 强制将变量转换为浮点型. 数值类型将转为浮点型; 字符串将使用Str2Float64; 布尔型的true为1.0,false为0; 数组、切片、字典、通道类型将取它们的长度; 指针、结构体类型为1.0,其他为0.
func (*LkkConvert) ToInt ¶
func (kc *LkkConvert) ToInt(val interface{}) int
ToInt 强制将变量转换为整型. 数值类型将转为整型; 字符串类型将使用Str2Int; 布尔型的true为1,false为0; 数组、切片、字典、通道类型将取它们的长度; 指针、结构体类型为1,其他为0.
type LkkDebug ¶
type LkkDebug struct { }
LkkDebug is the receiver of debug utilities
func (*LkkDebug) CallMethod ¶
func (kd *LkkDebug) CallMethod(t interface{}, method string, args ...interface{}) ([]interface{}, error)
CallMethod 调用对象的方法. 若执行成功,则结果是该方法的返回结果; 否则返回(nil, error).
func (*LkkDebug) GetCallName ¶
GetCallName 获取调用的方法名称;f为目标方法;onlyFun为true时仅返回方法,不包括包名.
func (*LkkDebug) GetCallPackage ¶
GetCallPackage 获取调用方法或调用文件的包名.callFile为调用文件路径.
func (*LkkDebug) GetFuncNames ¶
GetFuncNames 获取变量的所有(公开的)函数名.
type LkkEncrypt ¶
type LkkEncrypt struct { }
LkkEncrypt is the receiver of encrypt utilities
func (*LkkEncrypt) AesCBCDecrypt ¶
func (ke *LkkEncrypt) AesCBCDecrypt(cipherText, key []byte, paddingType ...LkkPKCSType) ([]byte, error)
AesCBCDecrypt AES-CBC密码分组链接(Cipher-block chaining)模式解密. cipherText为密文;key为密钥,长16/24/32;paddingType为填充方式,枚举(PKCS_NONE,PKCS_ZERO,PKCS_SEVEN),默认PKCS_SEVEN.
func (*LkkEncrypt) AesCBCEncrypt ¶
func (ke *LkkEncrypt) AesCBCEncrypt(clearText, key []byte, paddingType ...LkkPKCSType) ([]byte, error)
AesCBCEncrypt AES-CBC密码分组链接(Cipher-block chaining)模式加密.加密无法并行,不适合对流数据加密. clearText为明文;key为密钥,长16/24/32;paddingType为填充方式,枚举(PKCS_ZERO,PKCS_SEVEN),默认PKCS_SEVEN.
func (*LkkEncrypt) AesCFBDecrypt ¶
func (ke *LkkEncrypt) AesCFBDecrypt(cipherText, key []byte) ([]byte, error)
AesCFBDecrypt AES-CFB密文反馈(Cipher feedback)模式解密. cipherText为密文;key为密钥,长16/24/32.
func (*LkkEncrypt) AesCFBEncrypt ¶
func (ke *LkkEncrypt) AesCFBEncrypt(clearText, key []byte) ([]byte, error)
AesCFBEncrypt AES-CFB密文反馈(Cipher feedback)模式加密.适合对流数据加密. clearText为明文;key为密钥,长16/24/32.
func (*LkkEncrypt) AesCTRDecrypt ¶
func (ke *LkkEncrypt) AesCTRDecrypt(cipherText, key []byte) ([]byte, error)
AesCTRDecrypt AES-CTR计算器(Counter)模式解密. cipherText为密文;key为密钥,长16/24/32.
func (*LkkEncrypt) AesCTREncrypt ¶
func (ke *LkkEncrypt) AesCTREncrypt(clearText, key []byte) ([]byte, error)
AesCTREncrypt AES-CTR计算器(Counter)模式加密. clearText为明文;key为密钥,长16/24/32.
func (*LkkEncrypt) AesOFBDecrypt ¶
func (ke *LkkEncrypt) AesOFBDecrypt(cipherText, key []byte) ([]byte, error)
AesOFBDecrypt AES-OFB输出反馈(Output feedback)模式解密. cipherText为密文;key为密钥,长16/24/32.
func (*LkkEncrypt) AesOFBEncrypt ¶
func (ke *LkkEncrypt) AesOFBEncrypt(clearText, key []byte) ([]byte, error)
AesOFBEncrypt AES-OFB输出反馈(Output feedback)模式加密.适合对流数据加密. clearText为明文;key为密钥,长16/24/32.
func (*LkkEncrypt) AuthCode ¶
AuthCode 授权码编码或解码;encode为true时编码,为false解码;expiry为有效期,秒;返回结果为加密/解密的字符串和有效期时间戳.
func (*LkkEncrypt) Base64Decode ¶
func (ke *LkkEncrypt) Base64Decode(str []byte) ([]byte, error)
Base64Decode 对使用 MIME base64 编码的数据进行解码.
func (*LkkEncrypt) Base64Encode ¶
func (ke *LkkEncrypt) Base64Encode(str []byte) []byte
Base64Encode 使用 MIME base64 对数据进行编码.
func (*LkkEncrypt) Base64UrlDecode ¶
func (ke *LkkEncrypt) Base64UrlDecode(str []byte) ([]byte, error)
Base64UrlDecode url安全的Base64Decode.
func (*LkkEncrypt) Base64UrlEncode ¶
func (ke *LkkEncrypt) Base64UrlEncode(str []byte) []byte
Base64UrlSafeEncode url安全的Base64Encode,没有'/'和'+'及结尾的'=' .
func (*LkkEncrypt) EasyDecrypt ¶
func (ke *LkkEncrypt) EasyDecrypt(val, key []byte) []byte
EasyDecrypt 简单解密. val为待解密的字符串,key为密钥.
func (*LkkEncrypt) EasyEncrypt ¶
func (ke *LkkEncrypt) EasyEncrypt(data, key []byte) []byte
EasyEncrypt 简单加密. data为要加密的原字符串,key为密钥.
func (*LkkEncrypt) GenerateRsaKeys ¶
func (ke *LkkEncrypt) GenerateRsaKeys(bits int) (private []byte, public []byte, err error)
GenerateRsaKeys 生成RSA密钥对.bits为密钥位数,通常为1024或2048.
func (*LkkEncrypt) HmacShaX ¶
func (ke *LkkEncrypt) HmacShaX(data, secret []byte, x uint16) []byte
HmacShaX HmacSHA-x加密,x为1/256/512 .
func (*LkkEncrypt) PasswordHash ¶
func (ke *LkkEncrypt) PasswordHash(password []byte, costs ...int) ([]byte, error)
PasswordHash 创建密码的散列值;costs为算法的cost,范围4~31,默认10;注意:值越大越耗时.
func (*LkkEncrypt) PasswordVerify ¶
func (ke *LkkEncrypt) PasswordVerify(password, hash []byte) bool
PasswordVerify 验证密码是否和散列值匹配.
func (*LkkEncrypt) RsaPrivateDecrypt ¶
func (ke *LkkEncrypt) RsaPrivateDecrypt(cipherText, privateKey []byte) ([]byte, error)
RsaPrivateDecrypt RSA私钥解密.比加密耗时. cipherText为密文,privateKey为私钥.
func (*LkkEncrypt) RsaPrivateEncrypt ¶
func (ke *LkkEncrypt) RsaPrivateEncrypt(clearText, privateKey []byte) ([]byte, error)
RsaPrivateEncrypt RSA私钥加密.比解密耗时. clearText为明文,privateKey为私钥.
func (*LkkEncrypt) RsaPublicDecrypt ¶
func (ke *LkkEncrypt) RsaPublicDecrypt(cipherText, publicKey []byte) ([]byte, error)
RsaPublicDecrypt RSA公钥解密. cipherText为密文,publicKey为公钥.
func (*LkkEncrypt) RsaPublicEncrypt ¶
func (ke *LkkEncrypt) RsaPublicEncrypt(clearText, publicKey []byte) ([]byte, error)
RsaPublicEncrypt RSA公钥加密. clearText为明文,publicKey为公钥.
type LkkFile ¶
type LkkFile struct { }
LkkFile is the receiver of file utilities
func (*LkkFile) AppendFile ¶
AppendFile 插入文件内容.
func (*LkkFile) ChmodBatch ¶
ChmodBatch 批量改变路径权限模式(包括子目录和所属文件). filemode为文件权限模式,dirmode为目录权限模式.
func (*LkkFile) CopyDir ¶
CopyDir 拷贝源目录到目标目录,cover为枚举(FILE_COVER_ALLOW、FILE_COVER_IGNORE、FILE_COVER_DENY).
func (*LkkFile) CopyFile ¶
CopyFile 拷贝源文件到目标文件,cover为枚举(FILE_COVER_ALLOW、FILE_COVER_IGNORE、FILE_COVER_DENY).
func (*LkkFile) CountLines ¶
CountLines 统计文件行数.buffLength为缓冲长度,kb.
func (*LkkFile) FileTree ¶
func (kf *LkkFile) FileTree(fpath string, ftype LkkFileTree, recursive bool, filters ...FileFilter) []string
FileTree 获取目录的文件树列表. ftype为枚举(FILE_TREE_ALL、FILE_TREE_DIR、FILE_TREE_FILE); recursive为是否递归; filters为一个或多个文件过滤器函数,FileFilter类型.
func (*LkkFile) GetFileMode ¶
GetFileMode 获取路径的权限模式.
func (*LkkFile) GetModTime ¶
GetModTime 获取文件的修改时间戳,秒.
func (*LkkFile) Img2Base64 ¶
Img2Base64 读取图片文件,并转换为base64字符串.
func (*LkkFile) IsExecutable ¶
IsExecutable 是否可执行文件.
func (*LkkFile) IsFile ¶
func (kf *LkkFile) IsFile(fpath string, ftype ...LkkFileType) (res bool)
IsFile 是否(某类型)文件,且存在. ftype为枚举(FILE_TYPE_ANY、FILE_TYPE_LINK、FILE_TYPE_REGULAR、FILE_TYPE_COMMON),默认FILE_TYPE_ANY;
func (*LkkFile) Pathinfo ¶
Pathinfo 获取文件路径的信息. option为要返回的信息,枚举值如下: -1: all; 1: dirname; 2: basename; 4: extension; 8: filename; 若要查看某几项,则为它们之间的和.
func (*LkkFile) ReadFirstLine ¶
ReadFirstLine 读取文件首行.
func (*LkkFile) ReadInArray ¶
ReadInArray 把整个文件读入一个数组中,每行作为一个元素.
func (*LkkFile) ReadLastLine ¶
ReadLastLine 读取文件末行.
func (*LkkFile) SafeFileName ¶
SafeFileName 将文件名转换为安全可用的字符串.
type LkkNumber ¶
type LkkNumber struct { }
LkkNumber is the receiver of number utilities
func (*LkkNumber) AverageFloat64 ¶
AverageFloat64 对浮点数序列求平均值.
func (*LkkNumber) AverageInt ¶
AverageInt 对整数序列求平均值.
func (*LkkNumber) ByteFormat ¶
ByteFormat 格式化文件比特大小. size为文件大小,decimal为要保留的小数位数,delimiter为数字和单位间的分隔符.
func (*LkkNumber) FloatEqual ¶
FloatEqual 比较两个浮点数是否相等.decimal为小数精确位数,默认为 FLOAT_DECIMAL . 有效数值是长度(包括小数点)为17位之内的数值,最后一位会四舍五入.
func (*LkkNumber) GeoDistance ¶
GeoDistance 获取地理距离/米. 参数分别为两点的经度和纬度:lat:-90~90,lng:-180~180.
func (*LkkNumber) InRangeFloat32 ¶
InRangeFloat32 数值是否在2个32位浮点数范围内.
func (*LkkNumber) InRangeFloat64 ¶
InRangeFloat64 数值是否在2个64位浮点数范围内.
func (*LkkNumber) InRangeInt ¶
InRangeInt 数值是否在2个整数范围内.
func (*LkkNumber) IsNaturalRange ¶
IsNaturalRange 是否连续的自然数数组/切片,如[0,1,2,3...],其中不能有间断. strict为是否严格检查元素的顺序.
func (*LkkNumber) IsNegative ¶
IsNegative 数值是否为负数.
func (*LkkNumber) IsNonNegative ¶
IsNonNegative 数值是否为非负数.
func (*LkkNumber) IsNonPositive ¶
IsNonPositive 数值是否为非正数.
func (*LkkNumber) IsPositive ¶
IsPositive 数值是否为正数.
func (*LkkNumber) MaxFloat64 ¶
MaxFloat64 64位浮点数序列求最大值.
func (*LkkNumber) MinFloat64 ¶
MinFloat64 64位浮点数序列求最小值.
func (*LkkNumber) NearLogarithm ¶
NearLogarithm 求以 base 为底 num 的对数临近值. num为自然数,base为正整数,left是否向左取整.
func (*LkkNumber) NumberFormat ¶
NumberFormat 以千位分隔符方式格式化一个数字. decimal为要保留的小数位数,point为小数点显示的字符,thousand为千位分隔符显示的字符. 有效数值是长度(包括小数点)为17位之内的数值,最后一位会四舍五入.
func (*LkkNumber) RandFloat64 ¶
RandFloat64 生成一个min~max范围内的随机float64浮点数.
func (*LkkNumber) Range ¶
Range 根据范围创建数组,包含指定的元素. start为起始元素值,end为末尾元素值.若start<end,返回升序的数组;若start>end,返回降序的数组.
func (*LkkNumber) SplitNaturalNum ¶
SplitNaturalNum 将自然数 num 按底数 base 进行拆解.
func (*LkkNumber) SumFloat64 ¶
SumFloat64 浮点数求和.
type LkkOS ¶
type LkkOS struct { }
LkkOS is the receiver of OS utilities
func (*LkkOS) CpuUsage ¶
CpuUsage 获取CPU使用率(darwin系统必须使用cgo),单位jiffies(节拍数). user为用户态(用户进程)的运行时间, idle为空闲时间, total为累计时间.
func (*LkkOS) Exec ¶
Exec 执行一个外部命令. retInt为1时失败,为0时成功;outStr为执行命令的输出;errStr为错误输出. 命令如 "ls -a" "/bin/bash -c \"ls -a\""
func (*LkkOS) GetBiosInfo ¶
GetBiosInfo 获取BIOS信息. 注意:Mac机器没有BIOS信息,它使用EFI.
func (*LkkOS) GetHostByIp ¶
GetHostByIp 获取指定的IP地址对应的主机名.
func (*LkkOS) GetIpByHostname ¶
GetIpByHostname 返回主机名对应的 IPv4地址.
func (*LkkOS) GetIpsByDomain ¶
GetIpsByHost 获取互联网域名/主机名对应的 IPv4 地址列表.
func (*LkkOS) GetMacAddrs ¶
GetMacAddrs 获取本机的Mac网卡地址列表.
func (*LkkOS) GetPidByPort ¶
GetPidByPort 根据端口号获取监听的进程PID. linux可能要求root权限; darwin依赖lsof; windows依赖netstat.
func (*LkkOS) GetProcessExecPath ¶
GetProcessExecPath 根据PID获取进程的执行路径.
func (*LkkOS) IsPortOpen ¶
IsPortOpen 检查主机端口是否开放. host为主机名;port为(整型/字符串)端口号;protocols为协议名称,可选,默认tcp.
func (*LkkOS) IsPrivateIp ¶
IsPrivateIp 是否私有IP地址(ipv4/ipv6).
func (*LkkOS) IsProcessExists ¶
IsProcessExists 进程是否存在.
func (*LkkOS) IsPublicIP ¶
IsPublicIP 是否公网IPv4.
func (*LkkOS) MemoryUsage ¶
MemoryUsage 获取内存使用率,单位字节. 参数 virtual(仅支持linux),是否取虚拟内存. used为已用, free为空闲, total为总数.
func (*LkkOS) PrivateCIDR ¶
PrivateCIDR 获取私有网段的CIDR(无类别域间路由).
type LkkString ¶
type LkkString struct { }
LkkString is the receiver of string utilities
func (*LkkString) Addslashes ¶
Addslashes 使用反斜线引用字符串.
func (*LkkString) Big5ToUtf8 ¶
Big5ToUtf8 BIG5转UTF-8编码.
func (*LkkString) ChunkSplit ¶
ChunkSplit 将字符串分割成小块.str为要分割的字符,chunklen为分割的尺寸,end为行尾序列符号.
func (*LkkString) ClearUrlPrefix ¶
ClearUrlPrefix 清除URL的前缀; str为URL字符串,prefix为前缀,默认"/".
func (*LkkString) ClearUrlSuffix ¶
ClearUrlSuffix 清除URL的后缀; str为URL字符串,suffix为后缀,默认"/".
func (*LkkString) ClosestWord ¶
ClosestWord 获取与原字符串相似度最高的字符串,以及它们的编辑距离. word为原字符串,searchs为待查找的字符串数组.
func (*LkkString) CountBase64Byte ¶
CountBase64Byte 粗略统计base64字符串大小,字节.
func (*LkkString) CountWords ¶
CountWords 统计字符串中单词的使用情况. 返回结果:单词总数;和一个字典,包含每个单词的单独统计. 因为没有分词,对中文尚未很好支持.
func (*LkkString) DetectEncoding ¶
DetectEncoding 匹配字符编码,TODO.
func (*LkkString) FirstLetter ¶
FirstLetter 获取字符串首字母.
func (*LkkString) GetDomain ¶
GetDomain 从URL字符串中获取域名. 可选参数isMain,默认为false,取完整域名;为true时,取主域名(如abc.test.com取test.com).
func (*LkkString) GetEquationValue ¶
GetEquationValue 获取等式str中变量name的值.
func (*LkkString) HasChinese ¶
HasChinese 字符串是否含有中文.
func (*LkkString) HasEnglish ¶
HasEnglish 是否含有英文字符,HasLetter的别名.
func (*LkkString) HasFullWidth ¶
HasFullWidth 是否含有全角字符.
func (*LkkString) HasHalfWidth ¶
HasHalfWidth 是否含有半角字符.
func (*LkkString) HasSpecialChar ¶
HasSpecialChar 字符串是否含有特殊字符.
func (*LkkString) HasWhitespace ¶
HasWhitespace 是否带有空白字符.
func (*LkkString) HideMobile ¶
HideMobile 隐藏手机号.
func (*LkkString) HideTrueName ¶
HideTrueName 隐藏真实名称(如姓名、账号、公司等).
func (*LkkString) Htmlentities ¶
Htmlentities 将字符转换为 HTML 转义字符.
func (*LkkString) HtmlentityDecode ¶
HtmlentityDecode 将HTML实体转换为它们对应的字符.
func (*LkkString) HttpBuildQuery ¶
HttpBuildQuery 根据参数生成 URL-encode 之后的请求字符串.
func (*LkkString) Img2Base64 ¶
Img2Base64 将图片字节转换为base64字符串.ext为图片扩展名,默认jpg.
func (*LkkString) IsAlphaNumeric ¶
IsAlphaNumeric 是否字母或数字.
func (*LkkString) IsBase64Image ¶
IsBase64Image 是否base64编码的图片.
func (*LkkString) IsChineseName ¶
IsChineseName 字符串是否中文名称.
func (*LkkString) IsCreditNo ¶
IsCreditNo 检查是否(15或18位)身份证号码,并返回经校验的号码.
func (*LkkString) IsDialAddr ¶
IsDialAddr 是否网络拨号地址(形如127.0.0.1:80),用于net.Dial()检查.
func (*LkkString) IsEnglish ¶
func (ks *LkkString) IsEnglish(str string, letterCase LkkCaseSwitch) bool
IsEnglish 字符串是否纯英文.letterCase是否检查大小写,枚举值(CASE_NONE,CASE_LOWER,CASE_UPPER).
func (*LkkString) IsHexcolor ¶
IsHexcolor 检查是否十六进制颜色,并返回带"#"的修正值.
func (*LkkString) IsMobilecn ¶
IsMobilecn 检查字符串是否中国大陆手机号.
func (*LkkString) IsMultibyte ¶
IsMultibyte 字符串是否含有多字节字符.
func (*LkkString) IsRGBcolor ¶
IsRGBcolor 检查字符串是否RGB颜色格式.
func (*LkkString) IsRsaPublicKey ¶
IsRsaPublicKey 检查字符串是否RSA的公钥,keylen为密钥长度.
func (*LkkString) IsUrlExists ¶
IsUrlExists 检查URL是否存在.
func (*LkkString) IsWhitespaces ¶
IsWhitespaces 是否全部空白字符,不包括空字符串.
func (*LkkString) JsonDecode ¶
JsonDecode 对 JSON 格式的str字符串进行解码,注意res使用指针. 依赖库github.com/json-iterator/go.
func (*LkkString) JsonEncode ¶
JsonEncode 对val变量进行 JSON 编码. 依赖库github.com/json-iterator/go.
func (*LkkString) Jsonp2Json ¶
Jsonp2Json 将jsonp转为json串. Example: forbar({a:"1",b:2}) to {"a":"1","b":2}
func (*LkkString) Levenshtein ¶
Levenshtein 计算两个字符串之间的编辑距离,返回值越小字符串越相似. 注意字符串最大长度为255.
func (*LkkString) MatchEquations ¶
MatchEquations 匹配字符串中所有的等式.
func (*LkkString) MbSubstr ¶
MbSubstr 返回(宽字符)字符串str的子串. start 为起始位置.若值是负数,返回的结果将从 str 结尾处向前数第 abs(start) 个字符开始. length 为截取的长度.若值时负数, str 末尾处的 abs(length) 个字符将会被省略. start/length的绝对值必须<=原字符串长度.
func (*LkkString) ParseUrl ¶
ParseUrl 解析URL,返回其组成部分. component为需要返回的组成; -1: all; 1: scheme; 2: host; 4: port; 8: user; 16: pass; 32: path; 64: query; 128: fragment .
func (*LkkString) Random ¶
func (ks *LkkString) Random(length uint8, rtype LkkRandString) string
Random 生成随机字符串. length为长度,rtype为枚举: RAND_STRING_ALPHA 字母; RAND_STRING_NUMERIC 数值; RAND_STRING_ALPHANUM 字母+数值; RAND_STRING_SPECIAL 字母+数值+特殊字符; RAND_STRING_CHINESE 仅中文.
func (*LkkString) RawUrlDecode ¶
RawUrlDecode 对已编码的 URL 字符串进行解码.
func (*LkkString) RawUrlEncode ¶
RawUrlEncode 按照 RFC 3986 对 URL 进行编码.
func (*LkkString) RemoveAfter ¶
RemoveAfter 移除after之后的字符串; include为是否移除包括after本身; ignoreCase为是否忽略大小写.
func (*LkkString) RemoveBefore ¶
RemoveBefore 移除before之前的字符串; include为是否移除包括before本身; ignoreCase为是否忽略大小写.
func (*LkkString) RemoveEmoji ¶
RemoveEmoji 移除字符串中的表情符(使用正则,效率较低).
func (*LkkString) RemoveSpace ¶
RemoveSpace 移除字符串中的空白字符. all为true时移除全部空白,为false时只替换连续的空白字符为一个空格.
func (*LkkString) SimilarText ¶
SimilarText 计算两个字符串的相似度;返回在两个字符串中匹配字符的数目,以及相似程度百分数.
func (*LkkString) StartsWith ¶
StartsWith 字符串str是否以sub开头.
func (*LkkString) StartsWiths ¶
StartsWiths 字符串str是否以subs其中之一为开头.
func (*LkkString) Stripos ¶
Stripos 查找字符串首次出现的位置(不区分大小写),找不到时返回-1. haystack在该字符串中进行查找,needle要查找的字符串; offset起始位置,为负数时时,搜索会从字符串结尾指定字符数开始.
func (*LkkString) Stripslashes ¶
Stripslashes 反引用一个引用字符串.
func (*LkkString) Strpad ¶
Strpad 使用fill填充str字符串到指定长度max. ptype为填充类型,枚举值(PAD_LEFT,PAD_RIGHT,PAD_BOTH).
func (*LkkString) StrpadBoth ¶
StrpadBoth 字符串两侧填充,请参考Strpad.
func (*LkkString) StrpadLeft ¶
StrpadLeft 字符串左侧填充,请参考Strpad.
func (*LkkString) StrpadRight ¶
StrpadRight 字符串右侧填充,请参考Strpad.
func (*LkkString) Strpos ¶
Strpos 查找字符串首次出现的位置,找不到时返回-1. haystack在该字符串中进行查找,needle要查找的字符串; offset起始位置,为负数时时,搜索会从字符串结尾指定字符数开始.
func (*LkkString) Substr ¶
Substr 截取字符串str的子串. start 为起始位置.若值是负数,返回的结果将从 str 结尾处向前数第 abs(start) 个字符开始. length 为截取的长度.若值时负数, str 末尾处的 abs(length) 个字符将会被省略. start/length的绝对值必须<=原字符串长度.
func (*LkkString) SubstrCount ¶
SubstrCount 计算子串substr在字符串str中出现的次数,区分大小写.
func (*LkkString) SubstriCount ¶
SubstriCount 计算子串substr在字符串str中出现的次数,忽略大小写.
func (*LkkString) ToCamelCase ¶
ToCamelCase 转为驼峰写法. 去掉包括下划线"_"和横杠"-".
func (*LkkString) ToKebabCase ¶
ToSnakeCase 转为串形写法. 使用横杠"-"连接.
func (*LkkString) ToSnakeCase ¶
ToSnakeCase 转为蛇形写法. 使用下划线"_"连接.
func (*LkkString) UnSerialize ¶
UnSerialize 对字符串进行反序列化. 其中register注册对象,其类型必须和Serialize的一致.
func (*LkkString) Utf8ToBig5 ¶
Utf8ToBig5 UTF-8转BIG5编码.
func (*LkkString) VersionCompare ¶
VersionCompare 对比两个版本号字符串. operator允许的操作符有: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne . 特定的版本字符串,将会用以下顺序处理: 无 < dev < alpha = a < beta = b < RC = rc < # < pl = p < ga < release = r 用法: VersionCompare("1.2.3-alpha", "1.2.3RC7", '>=') ; VersionCompare("1.2.3-beta", "1.2.3pl", 'lt') ; VersionCompare("1.1_dev", "1.2any", 'eq') .
type LkkTime ¶
type LkkTime struct { }
LkkTime is the receiver of time utilities
func (*LkkTime) DaysBetween ¶
DaysBetween 获取两个日期的间隔天数. fromDate 为开始时间,toDate 为终点时间.
func (*LkkTime) EndOfMonth ¶
EndOfMonth 获取日期中当月的结束时间.
func (*LkkTime) GetMonthDays ¶
GetMonthDays 获取指定月份的天数.year年份,可选,默认当前年份.
func (*LkkTime) IsDate2time ¶
IsDate2time 检查字符串是否日期格式,并转换为时间戳.注意,时间戳可能为负数(小于1970年时). 匹配如:
0000 0000-00 0000/00 0000-00-00 0000/00/00 0000-00-00 00 0000/00/00 00 0000-00-00 00:00 0000/00/00 00:00 0000-00-00 00:00:00 0000/00/00 00:00:00
等日期格式.
func (*LkkTime) ServiceStartime ¶
ServiceStartime 获取当前服务启动时间戳,秒.
func (*LkkTime) ServiceUptime ¶
ServiceUptime 获取当前服务运行时间,纳秒int64.
func (*LkkTime) StartOfDay ¶
StartOfDay 获取日期中当天的开始时间.
func (*LkkTime) StartOfMonth ¶
StartOfMonth 获取日期中当月的开始时间.
func (*LkkTime) StartOfWeek ¶
StartOfWeek 获取日期中当周的开始时间; weekStartDay 周几作为周的第一天,本库默认周一.
func (*LkkTime) StartOfYear ¶
StartOfYear 获取日期中当年的开始时间.
func (*LkkTime) Str2Timestamp ¶
Str2Timestamp 将字符串转换为时间戳,秒. str 为要转换的字符串; format 为该字符串的格式,默认为"2006-01-02 15:04:05" .
func (*LkkTime) Str2Timestruct ¶
Str2Time 将字符串转换为时间结构. str 为要转换的字符串; format 为该字符串的格式,默认为"2006-01-02 15:04:05" .
type SystemInfo ¶
type SystemInfo struct { ServerName string `json:"server_name"` //服务器名称 SystemOs string `json:"system_os"` //操作系统名称 Runtime uint64 `json:"run_time"` //服务运行时间,纳秒 Uptime uint64 `json:"up_time"` //操作系统运行时间,秒 GoroutineNum int `json:"goroutine_num"` //goroutine数量 CpuNum int `json:"cpu_num"` //cpu核数 CpuUser float64 `json:"cpu_user"` //cpu用户态比率 CpuFree float64 `json:"cpu_free"` //cpu空闲比率 DiskUsed uint64 `json:"disk_used"` //已用磁盘空间,字节数 DiskFree uint64 `json:"disk_free"` //可用磁盘空间,字节数 DiskTotal uint64 `json:"disk_total"` //总磁盘空间,字节数 MemUsed uint64 `json:"mem_used"` //已用内存,字节数 MemSys uint64 `json:"mem_sys"` //系统内存占用量,字节数 MemFree uint64 `json:"mem_free"` //剩余内存,字节数 MemTotal uint64 `json:"mem_total"` //总内存,字节数 AllocGolang uint64 `json:"alloc_golang"` //golang内存使用量,字节数 AllocTotal uint64 `json:"alloc_total"` //总分配的内存,字节数 Lookups uint64 `json:"lookups"` //指针查找次数 Mallocs uint64 `json:"mallocs"` //内存分配次数 Frees uint64 `json:"frees"` //内存释放次数 LastGCTime uint64 `json:"last_gc_time"` //上次GC时间,纳秒 NextGC uint64 `json:"next_gc"` //下次GC内存回收量,字节数 PauseTotalNs uint64 `json:"pause_total_ns"` //GC暂停时间总量,纳秒 PauseNs uint64 `json:"pause_ns"` //上次GC暂停时间,纳秒 }
SystemInfo 系统信息