Documentation
¶
Index ¶
- Constants
- Variables
- func Base64Decode(code string) string
- func Base64Encode(s string) string
- func Base64URLDecode(data string) string
- func Base64UrlSafeEncode(data string) string
- func CreateOrder() int64
- func Exists(filePath string) bool
- func GenValidateCode(width int) string
- func GenerateTraceId() string
- func GetAddressByIP(ipA string) string
- func GetLocalIPs() (ips []string)
- func GetLock(redisConn *redis.Client, lockName string, ...) (string, error)
- func GetRandomString(l int) string
- func GetRandomString6(n uint64) []byte
- func GetString(d interface{}) string
- func InSliceString(k string, s []string) bool
- func IsNil(obj interface{}) bool
- func Md5(s string) string
- func ReleaseLock(redisConn *redis.Client, lockName, code string) bool
- func RemoteIp(r *http.Request) string
Constants ¶
View Source
const ( XForwardedFor = "X-Forwarded-For" // 获取真实ip XRealIP = "X-Real-IP" // 获取真实ip )
Variables ¶
View Source
var ( //CJson 全局json对象 CJson = jsonIter.ConfigCompatibleWithStandardLibrary )
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func Base64URLDecode ¶
Base64URLDecode 因为Base64转码后可能包含有+,/,=这些不安全的URL字符串,所以要进行换字符 '+' -> '-' '/' -> '_' '=' -> ” 字符串长度不足4倍的位补"="
func Base64UrlSafeEncode ¶
func GetLocalIPs ¶
func GetLocalIPs() (ips []string)
func GetLock ¶
func GetLock(redisConn *redis.Client, lockName string, acquireTimeout, lockTimeOut time.Duration) (string, error)
GetLock acquireTimeout Get the lock timeout period, If no lock is obtained within this period, err will be returned here lockTimeOut Lock timeout to prevent deadlock, lock automatically unlocked by this time
func InSliceString ¶
InSliceString string是否在[]string里面
func ReleaseLock ¶
ReleaseLock var count = 0 // test assist
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.