faet: 新增WS模块
This commit is contained in:
20
src/modules/ws/service/ws.go
Normal file
20
src/modules/ws/service/ws.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"ems.agt/src/modules/ws/model"
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
// IWS WebSocket通信 服务层接口
|
||||
type IWS interface {
|
||||
// UpgraderWs http升级ws请求
|
||||
UpgraderWs(w http.ResponseWriter, r *http.Request) *websocket.Conn
|
||||
|
||||
// NewClient 新建客户端 uid 登录用户ID
|
||||
NewClient(uid string, gids []string, conn *websocket.Conn) *model.WSClient
|
||||
|
||||
// CloseClient 客户端关闭
|
||||
CloseClient(clientID string)
|
||||
}
|
||||
Reference in New Issue
Block a user