Documentation ¶
Index ¶
- func Run(fn func(srv *Server))
- type Handler
- type Router
- type Server
- func (srv *Server) Lifecycle(hooks ...*lifecycle.Hook)
- func (srv *Server) Publish(topic string, v interface{}, opts ...broker.PublishOption)
- func (srv *Server) RegisterRouter(fn func(r *Router))
- func (srv *Server) RegisterRouterGroup(uri string, fn func(r *Router), handlers ...gin.HandlerFunc)
- func (srv *Server) Subscribe(topic string, handler broker.Handler, opts ...broker.SubscribeOption)
- func (srv *Server) Unmarshal(v interface{}) error
- func (srv *Server) Use(middleware ...gin.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler func(ctx *hfwContext.Context) interface{}
Handler 业务处理。成功时返回 response, 失败时返回 webserver.WebError
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server .
func (*Server) Publish ¶
func (srv *Server) Publish(topic string, v interface{}, opts ...broker.PublishOption)
Publish 消息异步发布
func (*Server) RegisterRouter ¶
RegisterRouter 注册路由
func (*Server) RegisterRouterGroup ¶
func (srv *Server) RegisterRouterGroup(uri string, fn func(r *Router), handlers ...gin.HandlerFunc)
RegisterRouterGroup 注册路由组
Click to show internal directories.
Click to hide internal directories.