Documentation ¶
Index ¶
- Constants
- Variables
- func AesDecrypt(encrypted, key []byte) ([]byte, error)
- func AesEncrypt(rawData, key []byte) ([]byte, error)
- func AnyToBool(raw interface{}) bool
- func AnyToFloat64(raw interface{}) float64
- func AnyToInt64(raw interface{}) int64
- func AnyToString(raw interface{}) string
- func Base62CusDecode(str string, baseChar string) uint64
- func Base62CusEncode(num uint64, baseChar string) string
- func Base62Decode(str string) uint64
- func Base62Encode(num uint64) string
- func Base64Decode(str interface{}, encode int) string
- func Base64Encode(str interface{}, encode int) string
- func Base64RawStdDecode(str interface{}) string
- func Base64RawStdEncode(str interface{}) string
- func Base64RawUrlDecode(str interface{}) string
- func Base64RawUrlEncode(str interface{}) string
- func Base64StdDecode(str interface{}) string
- func Base64StdEncode(str interface{}) string
- func Base64UrlDecode(str interface{}) string
- func Base64UrlEncode(str interface{}) string
- func BoolToStr(b bool) string
- func ByteToFloat32(bytes []byte) float32
- func ByteToFloat64(bytes []byte) float64
- func BytesToInt64(buf []byte) int64
- func BytesToString(b []byte) string
- func CamelToSnake(s string) string
- func CompressDir(pathToZip, dstPath string) error
- func ContainsString(array []string, val string) (index int)
- func CurlDelete(router string, body interface{}, header map[string]string) ([]byte, error)
- func CurlGet(router string, header map[string]string) ([]byte, error)
- func CurlPatch(router string, body interface{}, header map[string]string) ([]byte, error)
- func CurlPost(router string, body interface{}, header map[string]string) ([]byte, error)
- func CurlPostFile(uri string, fields map[string]string, files map[string]string, ...) ([]byte, error)
- func CurlPut(router string, body interface{}, header map[string]string) ([]byte, error)
- func CurlReq(method, router string, reqBody io.Reader, header map[string]string) (*http.Response, error)
- func CustomBase64(char ...string) *base64.Encoding
- func Debug(args ...interface{})
- func DeduplicateInt(ary *[]int)
- func DeduplicateInt64(ary *[]int64)
- func DeduplicateString(ary *[]string)
- func DeduplicateUint64(ary *[]uint64)
- func EmailInit(addr, identity, user, psw, host, from string)
- func EmailSend(subject, content string, to []string) error
- func EmojiCheck(s string) bool
- func EmojiFilter(s string) string
- func Empty(val interface{}) bool
- func EnvBool(key string, def ...bool) bool
- func EnvInt(key string, def ...int) int
- func EnvInt64(key string, def ...int64) int64
- func EnvStr(key string, def ...string) string
- func EnvStrs(key string, def ...string) []string
- func FileDirCreate(fDir string) error
- func FileExist(fpath string) bool
- func FileExt(fname string) string
- func FileNameFilter(name string) string
- func FilterAlphaNum(s string) string
- func Float32ToByte(float float32) []byte
- func Float32ToStr(f float32) string
- func Float64ToByte(float float64) []byte
- func Float64ToStr(f float64) string
- func Float64ToStrPrec1(f float64) string
- func FloatFormat(f float64, i int) float64
- func FloatToInt64(f float64) int64
- func GetBase64Md5(raw []byte) string
- func GetMd5(raw []byte) string
- func HttpBuild(body interface{}, sortAsc ...bool) string
- func HttpBuildQuery(args map[string]string, sortAsc ...bool) string
- func IPClient(req *http.Request) string
- func IPServer() string
- func IdDecode(dst string) (args []uint64)
- func IdEncode(args ...uint64) (dst string)
- func IdInc(s []string) []string
- func Int32ToBytes(i int32) []byte
- func Int64ToBytes(i int64) []byte
- func Int64ToStr(i int64) string
- func IntToStr(i int) string
- func JsonDecode(data []byte, v interface{}) error
- func JsonMarshal(interface{})
- func JsonMinify(data []byte) []byte
- func LvDecode(data []byte) []byte
- func LvDecodeAll(data []byte) [][]byte
- func LvEncode(data []byte) []byte
- func LvEncodeAll(data [][]byte) (res []byte)
- func Map2Struct(vals map[string]interface{}, dst interface{}) (err error)
- func Map2StructByTag(vals map[string]interface{}, dst interface{}, structTag string) (err error)
- func MaskString(src string, hLen int) string
- func Md5(str string) string
- func Md5Byte(b []byte) string
- func NetGetLocalIP() string
- func NetMacAddrs() (macAddrs []string)
- func NetServerIP()
- func RandHexHash(l int) string
- func RandNum(i int) string
- func RandStr(l int, c ...string) string
- func RandString(length int, chars []byte) string
- func RsaDecrypt(cipherText, privateKey []byte) ([]byte, error)
- func RsaEncrypt(rawData, publicKey []byte) ([]byte, error)
- func RsaKeyGen(bits int) error
- func RsaKeyGenText(bits int) (string, string, error)
- func Serialize(data interface{}) []byte
- func SerializeStr(data interface{}, arg ...interface{}) string
- func ShuffleSliceBytes(b []byte)
- func ShuffleSliceInt(i []int)
- func ShuffleSliceInterface(i []interface{})
- func ShuffleString(s *string)
- func SlashAdd(s string) string
- func SlashDel(s string) string
- func Slice2String(b []byte) (s string)
- func SliceJoin(sep string, elems ...interface{}) string
- func SliceStringToUint64(s []string) (i []uint64)
- func SnakeToCamel(s string) string
- func SplitZero(s string) (string, string)
- func SqlErrDuplicate(err error) bool
- func SqlErrNil(err error) bool
- func SqlErrNoRow(err error) bool
- func SqlIn(raw interface{}) string
- func SqlInSlice(raw interface{}) string
- func StrToBool(s string) bool
- func StrToFloat32(s string) float32
- func StrToFloat64(s string) float64
- func StrToInt(s string) int
- func StrToInt64(s string) int64
- func StrToTime(s string) (int64, error)
- func StrToUint64(s string) uint64
- func StringReplace(s string, old, new []string) string
- func StringToBytes(s string) []byte
- func StringToSlice(s string) (b []byte)
- func StringsBatchReplace(s string, old, new []string) (string, error)
- func Struct2Map(s interface{}) map[string]interface{}
- func Struct2MapByTag(s interface{}, tagName string) map[string]interface{}
- func TempGet(name string) (interface{}, error)
- func TempSet(name string, data interface{}) error
- func TimeFmtNanoUnix() string
- func TimeHmsToUnix(str string) (int64, error)
- func TimeInterval(unit string, amount int) (startTime, endTime int64)
- func TimeParse(format, src string) (time.Time, error)
- func TimeParseStd(src string) time.Time
- func TimeShortStr() string
- func TimeStdParseUnix(src string) int64
- func TimeStdStr() string
- func TimeToStr(unixSecTime interface{}, layout ...string) string
- func TlvDecode(data []byte) (tag uint8, b []byte)
- func TlvEncode(tag uint8, data []byte) []byte
- func ToByte(raw interface{}, e error) []byte
- func ToInt64(raw interface{}, e error) int64
- func ToString(raw interface{}, e error) (res string)
- func UUID() string
- func Uint64ToBytes(i uint64) []byte
- func Uint64ToStr(i uint64) string
- func Unserialize(b []byte, dst interface{})
- func ValidateChinaPhone(phone string) bool
- func ValidateEmail(email string) bool
- type AesCrypt
- type TagValue
Constants ¶
View Source
const ( Base64Std = iota Base64Url Base64RawStd Base64RawUrl )
View Source
const StdLen = 16
Variables ¶
View Source
var CurlDebug bool
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func AnyToFloat64 ¶
func AnyToFloat64(raw interface{}) float64
func AnyToInt64 ¶
func AnyToInt64(raw interface{}) int64
func AnyToString ¶
func AnyToString(raw interface{}) string
func Base62CusDecode ¶
Base62CusDecode 自定义base62解密
func Base62CusEncode ¶
Base62CusEncode 自定义base62加密
func Base64Decode ¶
func Base64Encode ¶
func Base64RawStdDecode ¶
func Base64RawStdDecode(str interface{}) string
func Base64RawStdEncode ¶
func Base64RawStdEncode(str interface{}) string
func Base64RawUrlDecode ¶
func Base64RawUrlDecode(str interface{}) string
func Base64RawUrlEncode ¶
func Base64RawUrlEncode(str interface{}) string
func Base64StdDecode ¶
func Base64StdDecode(str interface{}) string
func Base64StdEncode ¶
func Base64StdEncode(str interface{}) string
func Base64UrlDecode ¶
func Base64UrlDecode(str interface{}) string
func Base64UrlEncode ¶
func Base64UrlEncode(str interface{}) string
func ByteToFloat32 ¶
func ByteToFloat64 ¶
func BytesToInt64 ¶
func BytesToString ¶
func CompressDir ¶
func ContainsString ¶
ContainsString is 字符串是否包含在字符串切片里
func CurlDelete ¶
CurlDelete is curl delete
func CurlPostFile ¶
func CurlPostFile(uri string, fields map[string]string, files map[string]string, headers map[string]string) ([]byte, error)
CurlPostFile 以键值对Form表单形式上传文件
func CustomBase64 ¶
CustomBase64 custom base64 characters
func DeduplicateInt ¶
func DeduplicateInt(ary *[]int)
func DeduplicateInt64 ¶
func DeduplicateInt64(ary *[]int64)
func DeduplicateString ¶
func DeduplicateString(ary *[]string)
func DeduplicateUint64 ¶
func DeduplicateUint64(ary *[]uint64)
func EmojiCheck ¶
func EmojiFilter ¶
func FileDirCreate ¶
func FileNameFilter ¶
func FilterAlphaNum ¶
FilterAlphaNum remove not alpha, number and _ characters
func Float32ToByte ¶
func Float32ToStr ¶
func Float64ToByte ¶
func Float64ToStr ¶
func Float64ToStrPrec1 ¶
func FloatFormat ¶
func FloatToInt64 ¶
func GetBase64Md5 ¶
func HttpBuildQuery ¶
HttpBuildQuery build request query,sortAsc true为小到大,false为大到小,nil不排序 a=123&b=321
func Int32ToBytes ¶
func Int64ToBytes ¶
func Int64ToStr ¶
func JsonMarshal ¶
func JsonMarshal(interface{})
func JsonMinify ¶
func LvDecodeAll ¶
func LvEncodeAll ¶
func Map2Struct ¶
func Map2StructByTag ¶
func MaskString ¶
MaskString change string to abc***def
func NetGetLocalIP ¶
func NetGetLocalIP() string
func RandHexHash ¶
func RsaKeyGenText ¶
生成私钥文件, 返回 privateKey , publicKey, error
func SerializeStr ¶
func SerializeStr(data interface{}, arg ...interface{}) string
func ShuffleSliceBytes ¶
func ShuffleSliceBytes(b []byte)
func ShuffleSliceInt ¶
func ShuffleSliceInt(i []int)
func ShuffleSliceInterface ¶
func ShuffleSliceInterface(i []interface{})
func ShuffleString ¶
func ShuffleString(s *string)
func SliceStringToUint64 ¶
func SqlErrDuplicate ¶
func SqlErrNoRow ¶
func SqlInSlice ¶
func SqlInSlice(raw interface{}) string
SqlInSlice is same with SqlIn, and faster than SqlIn
func StrToFloat32 ¶
func StrToFloat64 ¶
func StrToInt64 ¶
func StrToUint64 ¶
func StringReplace ¶
func StringToBytes ¶
func StringsBatchReplace ¶
批量字符串替换
func Struct2Map ¶
func Struct2Map(s interface{}) map[string]interface{}
func Struct2MapByTag ¶
func TimeFmtNanoUnix ¶
func TimeFmtNanoUnix() string
func TimeInterval ¶
获取一个当前时间 时间间隔 时间戳
func TimeParseStd ¶
func TimeShortStr ¶
func TimeShortStr() string
func TimeStdParseUnix ¶
func TimeStdStr ¶
func TimeStdStr() string
func Uint64ToBytes ¶
func Uint64ToStr ¶
func Unserialize ¶
func Unserialize(b []byte, dst interface{})
func ValidateChinaPhone ¶
func ValidateEmail ¶
Types ¶
Source Files ¶
- aes.go
- base62.go
- base64.go
- boolean.go
- compress.go
- convert.go
- crypto.go
- curl.go
- debug.go
- duplicate.go
- emoji.go
- env.go
- file.go
- format.go
- id.go
- ip.go
- json.go
- mail.go
- map_and_struct.go
- md5.go
- net.go
- otp.go
- rand.go
- rsa.go
- serialize.go
- shuffle.go
- slice.go
- slice_and_string.go
- sql.go
- string.go
- temp.go
- time.go
- tlv.go
- uuid.go
- validate.go
- x.go
Click to show internal directories.
Click to hide internal directories.