Documentation
¶
Index ¶
- type Base
- type HttpServer
- type WebsocketServer
- func (component *WebsocketServer) Init(configInterface base.ConfigComponentInterface)
- func (component *WebsocketServer) OnClose(handler func(conn *models.WebsocketSession))
- func (component *WebsocketServer) OnConnect(handler func(conn *models.WebsocketSession))
- func (component *WebsocketServer) OnMessage(handler func(conn *models.WebsocketSession, recvMessage []byte))
- func (component *WebsocketServer) Register(handlerInterface controllers.HandlerInterface)
- func (component *WebsocketServer) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
base.ComponentInterface
// contains filtered or unexported fields
}
所有组件的基类
func (*Base) Init ¶
func (component *Base) Init(configInterface base.ConfigComponentInterface)
使用配置初始化数据
type HttpServer ¶
type HttpServer struct {
Base
// contains filtered or unexported fields
}
http服务
func (*HttpServer) Init ¶
func (component *HttpServer) Init(configInterface base.ConfigComponentInterface)
使用配置初始化数据
type WebsocketServer ¶
type WebsocketServer struct {
Base
// contains filtered or unexported fields
}
func (*WebsocketServer) Init ¶
func (component *WebsocketServer) Init(configInterface base.ConfigComponentInterface)
使用配置 初始化数据
func (*WebsocketServer) OnClose ¶
func (component *WebsocketServer) OnClose(handler func(conn *models.WebsocketSession))
设置 关闭连接的方法
func (*WebsocketServer) OnConnect ¶
func (component *WebsocketServer) OnConnect(handler func(conn *models.WebsocketSession))
设置 接受新连接的方法
func (*WebsocketServer) OnMessage ¶
func (component *WebsocketServer) OnMessage(handler func(conn *models.WebsocketSession, recvMessage []byte))
设置 接受消息的方法
func (*WebsocketServer) Register ¶
func (component *WebsocketServer) Register(handlerInterface controllers.HandlerInterface)
注册处理器。注册后将根据路由自动匹配调用方法
Click to show internal directories.
Click to hide internal directories.