[feat] 重新梳理依赖
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package contracts
|
||||
|
||||
import (
|
||||
"git.fsdpf.net/go/req"
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
type WsClientGroup string
|
||||
type WsClientID uint
|
||||
|
||||
// type WsClient struct {
|
||||
// User
|
||||
// Group WsClientGroup
|
||||
// Socket *websocket.Conn
|
||||
// }
|
||||
|
||||
type WsClient interface {
|
||||
req.User
|
||||
Socket() *websocket.Conn
|
||||
WsClientID() WsClientID
|
||||
WsClientGroup() WsClientGroup
|
||||
WsClientManage() WsClientManage
|
||||
Lock()
|
||||
Unlock()
|
||||
}
|
||||
|
||||
type WsClientManage interface {
|
||||
Register(WsClient) bool
|
||||
Unregister(WsClient)
|
||||
GetClients(func(WsClient) bool) []WsClient
|
||||
}
|
||||
|
||||
type WsChannelManage interface {
|
||||
Channel(string) WsClientManage
|
||||
}
|
||||
Reference in New Issue
Block a user