Documentation
¶
Index ¶
- type CallbackFunc
- type Handler
- func (h *Handler) AddController(v interface{}) *controller.Controller
- func (h *Handler) AddInterceptor(i interceptor.Interceptor, order int)
- func (h *Handler) Dispatch(ctx *app.RequestCtx)
- func (h *Handler) GetCtxPool() *sync.Pool
- func (h *Handler) IsRunning() bool
- func (h *Handler) Register(ctl *controller.RestfulController)
- func (h *Handler) RegisterGRPCService(serviceDesc *grpc.ServiceDesc, srv interface{}) *controller.Controller
- func (h *Handler) Serve(ctx *app.RequestCtx)
- func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SetAfterDispatchCallBack(callbackFunc CallbackFunc)
- func (h *Handler) SetBeforeDispatchCallBack(callbackFunc CallbackFunc)
- func (h *Handler) SetRunning(val bool) bool
- func (h *Handler) SortInterceptors()
- type HandlerCfg
- type HandlersChain
- type LimiterConfig
- type MethodTrees
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackFunc ¶
type CallbackFunc func(ctx *app.RequestContext) bool
CallbackFunc 在进行分发前进行回调的函数, 返回true结束
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(config HandlerCfg, logger logger.ILog) *Handler
func (*Handler) AddController ¶
func (h *Handler) AddController(v interface{}) *controller.Controller
func (*Handler) AddInterceptor ¶
func (h *Handler) AddInterceptor(i interceptor.Interceptor, order int)
func (*Handler) Dispatch ¶
func (h *Handler) Dispatch(ctx *app.RequestCtx)
func (*Handler) GetCtxPool ¶
func (*Handler) Register ¶
func (h *Handler) Register(ctl *controller.RestfulController)
func (*Handler) RegisterGRPCService ¶
func (h *Handler) RegisterGRPCService(serviceDesc *grpc.ServiceDesc, srv interface{}) *controller.Controller
func (*Handler) Serve ¶
func (h *Handler) Serve(ctx *app.RequestCtx)
func (*Handler) SetAfterDispatchCallBack ¶
func (h *Handler) SetAfterDispatchCallBack(callbackFunc CallbackFunc)
func (*Handler) SetBeforeDispatchCallBack ¶
func (h *Handler) SetBeforeDispatchCallBack(callbackFunc CallbackFunc)
func (*Handler) SortInterceptors ¶
func (h *Handler) SortInterceptors()
type HandlerCfg ¶
type HandlerCfg struct {
Name string `yaml:"name" default:"default"`
RootPath string `yaml:"rootPath"` // 可以为空
HeaderTraceID string `yaml:"headerTraceID" default:"X-Request-Id"`
ControllerRootPkgName string `yaml:"controllerRootPkgName" default:"controller"`
EnablePprof bool `yaml:"enablePprof"`
WebLimiter LimiterConfig `yaml:"webLimiter"`
EnableMetrics bool `yaml:"enableMetrics"`
DisableOptimization bool `yaml:"disableOptimization"`
EnableActionController bool `yaml:"enableActionController"`
EnableSwagger bool `yaml:"enableSwagger"`
}
type HandlersChain ¶
type LimiterConfig ¶
type MethodTrees ¶
type MethodTrees []*router
Click to show internal directories.
Click to hide internal directories.