Documentation ¶
Index ¶
- Constants
- func CodeIter(fn func(key int, value string) bool)
- func Engine() *gin.RouterGroup
- func GetMessage(code int) string
- func HttpHandleFunc(fn BbfHandlerFunc) gin.HandlerFunc
- func HttpHandler(handler BbfHandler) gin.HandlerFunc
- func Main() error
- func MergeCodes(codes Codes)
- func MetricsMiddleWare() func(ctx *gin.Context)
- func MockEngine() *gin.Engine
- func RegisterBeforeAppExitHook(opts ...func() error)
- func RegisterBeforeAppRunHook(opts ...func() error)
- func RequestTraceMiddle(failOut map[string]interface{}, ignore ...string) gin.HandlerFunc
- func RootEngine() *gin.Engine
- type BbfHandler
- type BbfHandlerFunc
- type Codes
- type State
- func (m *State) AsyncGrpcCtx() context.Context
- func (m *State) Context() context.Context
- func (m *State) Error(code int, err error)
- func (m *State) ErrorMessage(code int, txt string)
- func (m *State) GrpcClientCtx() context.Context
- func (m *State) Json(code int, v interface{}, err ...error)
- func (m *State) ShouldBindJSON(v interface{}) error
- func (m *State) Success(v interface{})
Constants ¶
View Source
const ( CodeSuccess = 0 CodeVersionError = 1 CodeUpdating = 101 CodeNotFound = 1000 CodeRequestUrlParamError = 1001 CodeRequestQueryParamError = 1002 CodeRequestBodyError = 1004 CodeNotLogin = 1005 CodeServerError = 1006 CodeNotAllow = 1007 CodeUnknownError = 1008 )
service inner error code list
Variables ¶
This section is empty.
Functions ¶
func Engine ¶
func Engine() *gin.RouterGroup
func GetMessage ¶
func HttpHandleFunc ¶
func HttpHandleFunc(fn BbfHandlerFunc) gin.HandlerFunc
func HttpHandler ¶
func HttpHandler(handler BbfHandler) gin.HandlerFunc
func MetricsMiddleWare ¶
func MockEngine ¶
func RegisterBeforeAppExitHook ¶
func RegisterBeforeAppExitHook(opts ...func() error)
func RegisterBeforeAppRunHook ¶
func RegisterBeforeAppRunHook(opts ...func() error)
func RequestTraceMiddle ¶
func RequestTraceMiddle(failOut map[string]interface{}, ignore ...string) gin.HandlerFunc
func RootEngine ¶
Types ¶
type BbfHandler ¶
type BbfHandler func(state *State)
type BbfHandlerFunc ¶
type State ¶
type State struct { *neon.Session logger.Logger Gin *gin.Context // contains filtered or unexported fields }
func (*State) AsyncGrpcCtx ¶
func (*State) ErrorMessage ¶
func (*State) GrpcClientCtx ¶
func (*State) ShouldBindJSON ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.