Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHttpServer ¶
func NewHttpServer(component base.ComponentInterface, port uint16)
Types ¶
type BaseConfig ¶
type BaseConfig struct {
base.ConfigComponentInterface
Component base.ComponentInterface // 需要初始化的组件实例
}
基础配置
func (*BaseConfig) GetComponent ¶
func (config *BaseConfig) GetComponent() base.ComponentInterface
获取配置需要初始化的组件
type PluginRouter ¶
type PluginRouter struct {
HandlerList []controllers.HandlerInterface
OnWebsocketMessageHandler func(conn *models.WebsocketSession, recvMessage []byte)
}
路由插件。添加这个插件后的配置可获取路由的参数
type WebsocketServer ¶
type WebsocketServer struct {
BaseConfig
PluginRouter
Port uint16 // 服务器端口
}
websocket server 所需的配置
func NewWebsocketServer ¶
func NewWebsocketServer(component base.ComponentInterface, port uint16) *WebsocketServer
新建 websocket server 配置
Click to show internal directories.
Click to hide internal directories.