Documentation
¶
Index ¶
- Constants
- type APIHandler
- func (h *APIHandler) RegisterRoutes(router *gin.Engine, routes *[]config.ProxyRoute)
- func (h *APIHandler) Response(ctx *gin.Context, msg string, biz_code ErrorCode, body gin.H)
- func (h *APIHandler) ResponseRaw(ctx *gin.Context, msg string, biz_code ErrorCode, body gin.H, code int)
- func (h *APIHandler) VerifyUser() gin.HandlerFunc
- type ErrorCode
Constants ¶
View Source
const ERR_OK = 0
View Source
const EnableProxyLog = true
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHandler ¶
APIHandler 是所有API的处理器
func NewAPIHandler ¶
func NewAPIHandler( api_secret string, token_lifespan uint32, dialector string, connection_str string, verbose bool, ) (*APIHandler, *gin.Engine)
// NewAPIHandler 创建APIHandler实例
func (*APIHandler) RegisterRoutes ¶
func (h *APIHandler) RegisterRoutes(router *gin.Engine, routes *[]config.ProxyRoute)
RegisterRoutes 注册路由
func (*APIHandler) ResponseRaw ¶
func (*APIHandler) VerifyUser ¶
func (h *APIHandler) VerifyUser() gin.HandlerFunc
type ErrorCode ¶
type ErrorCode uint32
const ( ERR_INVALID_PARAMETERS ErrorCode = iota + 1000 ERR_INVALID_USER ERR_INVALID_TOKEN ERR_INVALID_USER_ID ERR_TOKEN_EXPIRED ERR_TOKEN_GENERATE_FAILED ERR_DATA_PERSISTENCE ERR_REGISTER_FAILED ERR_SENDEMAIL_FAILED ERR_ACTIVIATE_FAILED ERR_DEACTIVIATE_FAILED ERR_GENERATE_TOKEN_FAILED ERR_UNKNOWN_FAILED )
Click to show internal directories.
Click to hide internal directories.