Documentation
¶
Index ¶
- Variables
- func CheckErrWithCode(err error, code StatusCode, c *gin.Context) (ref bool)
- func CheckWithCode(ok bool, code StatusCode, c *gin.Context) (ref bool)
- func PingHandler(c *gin.Context)
- func SetCacheManager(mem uint64, shardSize uintptr, mode uint8) func()
- func SetIpMap(_ipMap *sync.Map)
- func SetPrivateKey(privateKeyPath string) error
- type ApiResponse
- type StatusCode
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Manager go_cache.CacheManager IpMap *sync.Map PrivateKey *rsa.PrivateKey )
View Source
var (
RsaDecryptErrorMsg = "解密失败"
)
Functions ¶
func CheckErrWithCode ¶
func CheckErrWithCode(err error, code StatusCode, c *gin.Context) (ref bool)
func CheckWithCode ¶
func CheckWithCode(ok bool, code StatusCode, c *gin.Context) (ref bool)
func PingHandler ¶
func SetCacheManager ¶
func SetPrivateKey ¶
Types ¶
type ApiResponse ¶
type ApiResponse struct { Msg string `json:"err,omitempty"` Data string `json:"data,omitempty"` Code StatusCode `json:"code,omitempty"` }
type StatusCode ¶
type StatusCode int
const ( SUCCESS StatusCode = 0 DecodeError StatusCode = 1001 EncodeError StatusCode = 1002 MapPutError StatusCode = 2001 RsaDecryptError StatusCode = 4001 RsaEncryptError StatusCode = 4002 RasCipherTextUnValidError StatusCode = 4003 )
Click to show internal directories.
Click to hide internal directories.