Documentation ¶
Overview ¶
*
- Created by lock
- Date: 2019-08-18
- Time: 18:03
*
- Created by lock
- Date: 2019-08-12
- Time: 16:00
*
- Created by lock
- Date: 2019-08-12
- Time: 14:18
*
- Created by lock
- Date: 2019-10-06
- Time: 23:30
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(nodeIDs ...int64) 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 = 0 CodeFail = 1 CodeUnknownError = -1 CodeSessionError = 40000 )
View Source
const SessionPrefix = "sess_"
Variables ¶
View Source
var MsgCodeMap = map[int]string{ CodeUnknownError: "unknown error", CodeSuccess: "success", CodeFail: "fail", CodeSessionError: "session error", }
View Source
var RedisClientMap = map[string]*redis.Client{}
Functions ¶
func CityHash32 ¶
func CityHash64 ¶
func CityHash64WithSeeds ¶
func CreateSessionId ¶
func FailWithMsg ¶
func GetNowDateTime ¶
func GetNowDateTime() string
func GetRandomToken ¶
func GetRedisInstance ¶
func GetRedisInstance(redisOpt RedisOption) *redis.Client
func GetSessionIdByUserId ¶
func GetSessionName ¶
func GetSnowflakeId ¶
func IsLittleEndian ¶
func IsLittleEndian() bool
func ParseNetwork ¶
func ResponseWithCode ¶
func SuccessWithMsg ¶
Types ¶
type RedisOption ¶
Click to show internal directories.
Click to hide internal directories.