Documentation ¶
Index ¶
- Variables
- func AesCBCDecrypt(crypted, key []byte) ([]byte, error)
- func AesCBCEncrypt(origData, key []byte) ([]byte, error)
- func AesDecryptCBCByKey(crypted string, key string) (res string, err error)
- func AesDecryptECBByKey(crypted string, key string) (res string, err error)
- func AesECBDecrypt(data, key []byte) ([]byte, error)
- func AesECBEncrypt(data, key []byte) ([]byte, error)
- func AesEncryptCBCByKey(origData string, key string) (res string, err error)
- func AesEncryptECBByKey(origData string, key string) (res string, err error)
- func ArrayIndexOf(array interface{}, v interface{}) (index int)
- func FirstToLower(str string) (res string)
- func FirstToUpper(str string) (res string)
- func FormatPath(path string) string
- func GetAbsolutePath(path string) (absolutePath string)
- func GetFileType(fSrc []byte) string
- func GetFormatByTime(v time.Time) string
- func GetIpFromAddr(addr net.Addr) net.IP
- func GetLocalIPList() (ipList []net.IP)
- func GetLock(key string) (lock sync.Locker)
- func GetMD5(str string) string
- func GetNow() time.Time
- func GetNowFormat() string
- func GetNowSecond() int64
- func GetNowTime() int64
- func GetRootDir() string
- func GetSecondByTime(v time.Time) int64
- func GetStringValue(value interface{}) (valueString string)
- func GetTimeByTime(v time.Time) int64
- func GetUUID() (res string)
- func GzipBytes(data []byte) ([]byte, error)
- func Int64IndexOf(array []int64, v int64) (index int)
- func IntIndexOf(array []int, v int) (index int)
- func IsEmpty(v interface{}) bool
- func IsFalse(v interface{}) (res bool)
- func IsNotEmpty(v interface{}) bool
- func IsTrue(v interface{}) (res bool)
- func LoadDirFilenames(dir string) (filenames []string, err error)
- func LoadDirFiles(dir string) (fileMap map[string][]byte, err error)
- func LockByKey(key string)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PathExists(path string) (bool, error)
- func RandomInt(min int, max int) (res int)
- func RandomInt64(min int64, max int64) (res int64)
- func RandomString(minLen int, maxLen int) (res string)
- func RandomUserName(size int) (res string)
- func Read(reader io.Reader, buf []byte, onRead func(n int) (err error)) (err error)
- func ReadByFunc(read func(p []byte) (n int, err error), buf []byte, ...) (err error)
- func ReadFile(filename string) (bs []byte, err error)
- func ReadFileString(filename string) (str string, err error)
- func ReadLine(filename string) (lines []string, err error)
- func RsaDecrypt(ciphertext []byte, privateKey []byte) ([]byte, error)
- func RsaDecryptByKey(crypted string, privateKey string) (res string, err error)
- func RsaEncrypt(origData []byte, publicKey []byte) ([]byte, error)
- func RsaEncryptByKey(origData string, publicKey string) (res string, err error)
- func StringIndexOf(array []string, v string) (index int)
- func TimeFormat(v time.Time, layout string) string
- func ToPinYin(name string) (res string, err error)
- func UnGzipBytes(data []byte) ([]byte, error)
- func UnZip(zipFile string, destDir string) error
- func UnlockByKey(key string)
- func Write(writer io.Writer, buf []byte, onWrite func(n int) (err error)) (err error)
- func WriteFile(filename string, bs []byte) (err error)
- func WriteFileString(filename string, str string) (err error)
- func Zip(srcFile string, destZip string) error
Constants ¶
This section is empty.
Variables ¶
var ( RandChats = []string{ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "z", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "Z", "Y", "Z", "_", } RandChatsSize = len(RandChats) )
var ( FirstName = []string{}/* 292 elements not displayed */ LastName = []string{}/* 350 elements not displayed */ FirstNameLen = len(FirstName) LastNameLen = len(LastName) )
var (
// DefaultTimeFormatLayout 默认时间格式化
DefaultTimeFormatLayout = `2006-01-02 15:04:05`
)
var (
Logger *zap.Logger
)
Functions ¶
func AesCBCDecrypt ¶ added in v0.0.2
AesCBCDecrypt CBC模式解密
func AesCBCEncrypt ¶ added in v0.0.2
AesCBCEncrypt CBC模式加密
func AesDecryptCBCByKey ¶ added in v0.0.2
AesDecryptCBCByKey AES解密,CBC
func AesDecryptECBByKey ¶ added in v0.0.2
AesDecryptECBByKey AES解密,ECB
func AesECBDecrypt ¶ added in v0.0.2
AesECBDecrypt ECB模式解密
func AesECBEncrypt ¶ added in v0.0.2
AesECBEncrypt ECB模式加密
func AesEncryptCBCByKey ¶ added in v0.0.2
AesEncryptCBCByKey AES加密,CBC
func AesEncryptECBByKey ¶ added in v0.0.2
AesEncryptECBByKey AES加密,ECB
func ArrayIndexOf ¶ added in v0.0.2
func ArrayIndexOf(array interface{}, v interface{}) (index int)
ArrayIndexOf 返回 某个值 在数组中的索引位置,未找到返回 -1
func FirstToLower ¶ added in v0.0.2
FirstToLower 字符首字母小写 @param str string "任意字符串" @return string
func FirstToUpper ¶ added in v0.0.2
FirstToUpper 字符首字母大写 @param str string "任意字符串" @return string
func GetAbsolutePath ¶ added in v0.0.2
GetAbsolutePath 获取路径觉得路径
func GetFileType ¶ added in v0.0.2
GetFileType 用文件前面几个字节来判断 fSrc: 文件字节流(就用前面几个字节)
func GetFormatByTime ¶ added in v0.0.2
GetFormatByTime 获取格式化时间 `2006-01-02 15:04:05` @param v time.Time "时间"
func GetLocalIPList ¶ added in v0.0.2
GetLocalIPList 获取当前IP列表
func GetNowFormat ¶ added in v0.0.2
func GetNowFormat() string
GetNowFormat 获取当前格式化时间 `2006-01-02 15:04:05`
func GetSecondByTime ¶ added in v0.0.2
GetSecondByTime 获取时间戳 到秒 @param v time.Time "时间"
func GetStringValue ¶ added in v0.0.2
func GetStringValue(value interface{}) (valueString string)
GetStringValue 将传入的值转为字符串 @param value interface{} "任意值" @return string
func GetTimeByTime ¶ added in v0.0.2
GetTimeByTime 获取时间戳 到毫秒 @param v time.Time "时间"
func Int64IndexOf ¶ added in v0.0.2
Int64IndexOf 返回 某个值 在数组中的索引位置,未找到返回 -1
func IntIndexOf ¶ added in v0.0.2
IntIndexOf 返回 某个值 在数组中的索引位置,未找到返回 -1
func IsEmpty ¶ added in v0.0.2
func IsEmpty(v interface{}) bool
IsEmpty 是否为nil或空字符串 @param v interface{} "传入任意值" @return bool
func IsFalse ¶ added in v0.0.2
func IsFalse(v interface{}) (res bool)
IsFalse 是否为否 判断不是true、"true"、1、"1" @param v interface{} "传入任意值" @return bool
func IsNotEmpty ¶ added in v0.0.2
func IsNotEmpty(v interface{}) bool
IsNotEmpty 是否不为nil或空字符串 @param v interface{} "传入任意值" @return bool
func IsTrue ¶ added in v0.0.2
func IsTrue(v interface{}) (res bool)
IsTrue 是否为真 判断是true、"true"、1、"1" @param v interface{} "传入任意值" @return bool
func LoadDirFilenames ¶ added in v0.0.2
LoadDirFilenames 加载目录下文件(文件名为相对路径)
func LoadDirFiles ¶ added in v0.0.2
LoadDirFiles 加载目录下文件 读取文件内容(key为文件名为相对路径)
func PKCS5Padding ¶ added in v0.0.2
func PKCS5UnPadding ¶ added in v0.0.2
func RandomInt ¶ added in v0.0.2
RandomInt 获取随机数 @param min int "最小值" @param max int "最大值" @return int "随机数"
func RandomInt64 ¶ added in v0.0.2
RandomInt64 获取随机数 @param min int64 "最小值" @param max int64 "最大值" @return int64 "随机数"
func RandomString ¶ added in v0.0.2
RandomString 获取随机字符串 @param minLen int "最小长度" @param maxLen int "最大长度" @return string
func RandomUserName ¶ added in v0.0.2
RandomUserName 随机姓名 @param size int "名长度" @return string
func ReadByFunc ¶ added in v0.0.2
func ReadFileString ¶ added in v0.0.4
ReadFileString 读取文件内容 返回字符串
func RsaDecrypt ¶ added in v0.0.3
RsaDecrypt 解密
func RsaDecryptByKey ¶ added in v0.0.3
RsaDecryptByKey RSA解密
func RsaEncrypt ¶ added in v0.0.3
RsaEncrypt 加密
func RsaEncryptByKey ¶ added in v0.0.3
RsaEncryptByKey RSA加密
func StringIndexOf ¶ added in v0.0.2
StringIndexOf 返回 某个值 在数组中的索引位置,未找到返回 -1
func TimeFormat ¶ added in v0.0.2
TimeFormat 时间格式化 默认 `2006-01-02 15:04:05` @param v time.Time "时间" @param layout string "格式化字符串,默认使用`2006-01-02 15:04:05`"
func WriteFileString ¶ added in v0.0.4
WriteFileString 写入文件内容
Types ¶
This section is empty.