Documentation ¶
Index ¶
- Constants
- Variables
- func CityHash32(s []byte, length uint32) uint32
- func CityHash64(s []byte, length uint32) uint64
- func CityHash64WithSeed(s []byte, length uint32, seed uint64) uint64
- func CityHash64WithSeeds(s []byte, length uint32, seed0, seed1 uint64) uint64
- func CreateSessionID(sessionID string) string
- func FailWithMsg(c *gin.Context, msg interface{})
- func GetNowDateTime() string
- func GetRandomToken(length int) string
- func GetRedisInstance(redisOpt RedisOption) *redis.Client
- func GetSessionIDByUserID(userID int) string
- func GetSessionName(sessionID string) string
- func GetSnowflakeID() string
- func IsLittleEndian() bool
- func ParseNetwork(str string) (network, addr string, err error)
- func ResponseWithCode(c *gin.Context, msgCode int, msg interface{}, data interface{})
- func Sha1(s string) (str string)
- func SuccessWithMsg(c *gin.Context, msg interface{}, data interface{})
- type RedisOption
- type Uint128
Constants ¶
View Source
const ( // CodeSuccess ... CodeSuccess = 0 // CodeFail ... CodeFail = 1 // CodeUnknownError ... CodeUnknownError = -1 // CodeSessionError ... CodeSessionError = 40000 )
View Source
const SessionPrefix = "sess_"
SessionPrefix ...
Variables ¶
View Source
var MsgCodeMap = map[int]string{ CodeUnknownError: "unKnow error", CodeSuccess: "success", CodeFail: "fail", CodeSessionError: "Session error", }
MsgCodeMap ...
View Source
var RedisClientMap = map[string]*redis.Client{}
RedisClientMap ...
Functions ¶
func CityHash32 ¶
func CityHash64 ¶
func CityHash64WithSeeds ¶
func GetRedisInstance ¶
func GetRedisInstance(redisOpt RedisOption) *redis.Client
GetRedisInstance ...
func IsLittleEndian ¶
func IsLittleEndian() bool
func ParseNetwork ¶
ParseNetwork ...
func ResponseWithCode ¶
ResponseWithCode ...
func SuccessWithMsg ¶
SuccessWithMsg ...
Types ¶
type RedisOption ¶
RedisOption ...
Click to show internal directories.
Click to hide internal directories.