1 Star 0 Fork 0

庞飞/multiapp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
handler.go 913 Bytes
一键复制 编辑 原始数据 按行查看 历史
庞飞 提交于 2023-10-03 10:28 +08:00 . 合并主框架
package websocket
import (
"net/http"
Controller "gitee.com/pangxianfei/multiapp/http/controller/gincontroller"
"gitee.com/pangxianfei/multiapp/kernel/zone"
"gitee.com/pangxianfei/multiapp/request"
)
type Handler interface {
DefaultChannels() []string
OnMessage(hub Hub, msg *Msg)
Loop(hub Hub) error
OnPing(hub Hub, appData string)
OnPong(hub Hub, appData string)
OnClose(hub Hub, code int, text string)
configer
Controller.Controller
}
type Hub interface {
Send(msg *Msg)
Broadcast(msg *Msg)
BroadcastTo(channelName string, msg *Msg)
name() string
available() bool
channeller
request.Context
}
type configer interface {
ReadBufferSize() int
WriteBufferSize() int
CheckOrigin(r *http.Request) bool
WriteTimeout() zone.Duration
ReadTimeout() zone.Duration
MaxMessageSize() int64
}
type channeller interface {
JoinChannel(channelName string)
LeaveChannel(channelName string)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/pangxianfei/multiapp.git
git@gitee.com:pangxianfei/multiapp.git
pangxianfei
multiapp
multiapp
v1.2.3

搜索帮助