Documentation ¶
Index ¶
- Variables
- func ClientIP(c *http.Request) string
- func GetWsCenter() *wsCenter
- func InitWsServer()
- func NewWsCenter(maxConn int32)
- type WsConnection
- func (w *WsConnection) GetIp() string
- func (w *WsConnection) GetUid() uint32
- func (w *WsConnection) GetWsId() string
- func (w *WsConnection) ReadMsg() (message interface{}, err error)
- func (w *WsConnection) SendMsg(msg interface{}) (err error)
- func (w *WsConnection) SetIp(ip string)
- func (w *WsConnection) SetUid(uid uint32)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
WsErrConnLoss = errors.New("conn already close")
)
Functions ¶
func GetWsCenter ¶
func GetWsCenter() *wsCenter
func InitWsServer ¶
func InitWsServer()
func NewWsCenter ¶
func NewWsCenter(maxConn int32)
Types ¶
type WsConnection ¶
type WsConnection struct {
// contains filtered or unexported fields
}
func NewWsConnection ¶
func NewWsConnection(conn *websocket.Conn) *WsConnection
func (*WsConnection) GetIp ¶
func (w *WsConnection) GetIp() string
func (*WsConnection) GetUid ¶
func (w *WsConnection) GetUid() uint32
func (*WsConnection) GetWsId ¶
func (w *WsConnection) GetWsId() string
func (*WsConnection) ReadMsg ¶
func (w *WsConnection) ReadMsg() (message interface{}, err error)
func (*WsConnection) SendMsg ¶
func (w *WsConnection) SendMsg(msg interface{}) (err error)
func (*WsConnection) SetIp ¶
func (w *WsConnection) SetIp(ip string)
func (*WsConnection) SetUid ¶
func (w *WsConnection) SetUid(uid uint32)
Click to show internal directories.
Click to hide internal directories.