Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WebsocketServer ¶
func WebsocketServer() *websocketServer
Websocket return ws websocketServer instance
Types ¶
type WebsocketConn ¶
type WebsocketConn struct {
// unique id
ID string
// contains filtered or unexported fields
}
websocketConn include socket conn
func (*WebsocketConn) GetID ¶
func (c *WebsocketConn) GetID() string
type WsServer ¶
type WsServer interface {
Register(conn *WebsocketConn, handler Handler)
Unregister(id string)
Start()
Broadcast(message []byte, ignore *WebsocketConn)
Send(message []byte, c *WebsocketConn)
UpgradeConn(w http.ResponseWriter, r *http.Request) (*WebsocketConn, error)
GetOnline() int
//GetOnlines()(*websocketServer)
IsRegist(uuid string) int
GetConnection(uuid string) *WebsocketConn
}
WsServer
Directories
¶
| Path | Synopsis |
|---|---|
|
component
|
|
|
mysql
Adapter 实现读写分离的gorm适配器 通过实现gorm里的SQLCommon接口实现读写分离的适配 TODO 读库可能存在多个,可以通过基于权重的副在均衡算法完成连接工作的分配
|
Adapter 实现读写分离的gorm适配器 通过实现gorm里的SQLCommon接口实现读写分离的适配 TODO 读库可能存在多个,可以通过基于权重的副在均衡算法完成连接工作的分配 |
|
http
|
|
|
response
r 基于gin的Context,实现响应数据结构体 集成全局traceID
|
r 基于gin的Context,实现响应数据结构体 集成全局traceID |
Click to show internal directories.
Click to hide internal directories.