Documentation
¶
Index ¶
- Constants
- func AesDecode(encryptedString string) (string, error)
- func AesEncode(rawString string) (string, error)
- func Base64Decode(encodedString string) ([]byte, error)
- func Base64Encode(rawBytes []byte) string
- func FileAppendContents(content []byte, dst string) error
- func FileExists(dst string) bool
- func FileExistsWithError(dst string) (bool, error)
- func FileExt(filename string) string
- func FileGetContents(filename string) ([]byte, error)
- func FilePutContents(content []byte, dst string) error
- func GetLocalIP() (string, error)
- func ListeningExitSignal(wg *sync.WaitGroup)
- func RSADecrypt(encodedString string, privateKey []byte) (string, error)
- func RSAEncrypt(rawString string, publicKey []byte) (string, error)
- func RSASign(rawStringBytes, privateKey []byte) (string, error)
- func RSAVerifySign(rawStringBytes, sign, publicKey []byte) (bool, error)
- func RandomDigitalChars(length int) string
- func RandomLetters(length int) string
- func SaveFile2Dst(file *multipart.FileHeader, dst string) error
- func Wordwrap(rawStr string, length int, split string) string
- func WrapRedisKey(appName, key string) string
- type TIM
Constants ¶
View Source
const KEY = "fakeKeyChangeMe!"
KEY 密钥
Variables ¶
This section is empty.
Functions ¶
func GetLocalIP ¶
func ListeningExitSignal ¶
ListeningExitSignal 监听系统退出信号
func RSADecrypt ¶
RSADecrypt rsa解密
func RSAEncrypt ¶
RSAEncrypt rsa加密
func RSAVerifySign ¶
RSAVerifySign rsa验签
func SaveFile2Dst ¶
func SaveFile2Dst(file *multipart.FileHeader, dst string) error
SaveFile2Dst 将文件保存到目标地址(拷贝文件)
file *multipart.FileHeader 文件
dst string 拷贝到的目标地址
func WrapRedisKey ¶
WrapRedisKey 包装redis键名
给redis的键加入应用名前缀,如:
appName=game key=user
最终的redis键名为:game:user
此方法的主要作用是按应用来划分redis键名
Types ¶
type TIM ¶
type TIM struct {
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.