Documentation ¶
Index ¶
- Constants
- Variables
- func NewConfigConsole() *configs.Console
- func NewConfigDatabase(driverName string, host string, port string, name string, username string, ...) *configs.Database
- func NewConfigHttpServer(port uint16) *configs.HttpServer
- func NewConfigWebsocketServer(port uint16) *configs.WebsocketServer
- type BaseController
- type Config
Constants ¶
View Source
const ( ComponentWebsocketServer = constants.ComponentWebsocketServer // 应用状态:初始化 ApplicationStatusInit = constants.ApplicationStatusInit // 应用状态:开始(启动中) ApplicationStatusStart = constants.ApplicationStatusStart // 应用状态:即将停止 ApplicationStatusStop = constants.ApplicationStatusStop // websocket server 运行模式:自动处理【推荐】 // 使用框架内规定的 Handler 或 BaseController 自动匹配对应的方法。发送数据必须是规范的数据。 // 使用该模式依然可以使用 OnMessage 接收数据。但是不能发送数据 WebsocketServerModeAutoHandler = constants.WebsocketServerModeAutoHandler // websocket server 运行模式:自定义处理。 // 自定义 OnMessage 回调方法发送数据。根据实际需求自定义数据返回 WebsocketServerModeCustom = constants.WebsocketServerModeCustom // 控制器类型:websocket ControllerTypeWebsocket = constants.ControllerTypeWebsocket // 控制器类型:http ControllerTypeHttp = constants.ControllerTypeHttp )
Variables ¶
View Source
var App = newApplication()
应用全局实例(只需要一个实例即可操作整个应用)
Functions ¶
func NewConfigDatabase ¶ added in v0.0.2
func NewConfigDatabase(driverName string, host string, port string, name string, username string, password string) *configs.Database
新建 数据库配置
func NewConfigHttpServer ¶ added in v0.0.2
func NewConfigHttpServer(port uint16) *configs.HttpServer
新建 http server 配置
func NewConfigWebsocketServer ¶ added in v0.0.2
func NewConfigWebsocketServer(port uint16) *configs.WebsocketServer
新建 websocket server 配置
Types ¶
type BaseController ¶ added in v0.0.2
type BaseController struct {
models.BaseController
}
基础 websocket 处理器
Click to show internal directories.
Click to hide internal directories.