Documentation ¶
Index ¶
- func WrapH(s *gosocketio.Server) http.HandlerFunc
- type ConnectParam
- type RoomDescribe
- type RoomDescribeListResponse
- type RoomFunc
- type SocketioServer
- func (serve *SocketioServer) ClearRoomHandler(room string)
- func (server *SocketioServer) Debug(data any)
- func (server *SocketioServer) Error(data any)
- func (server *SocketioServer) Info(data any)
- func (serve *SocketioServer) JoinRoomHander(room string, f func(room string))
- func (serve *SocketioServer) LeaveRoomHander(room string, f func(userID int64, deviceID, deviceType, room string))
- func (socket *SocketioServer) ListAllSocket() (map[string]string, map[int64]map[string][]*ConnectParam)
- func (socket *SocketioServer) ListRooms() []RoomDescribe
- func (socket *SocketioServer) NewID() string
- func (socket *SocketioServer) Run(httpServer *http.Server)
- func (socket *SocketioServer) SendEventToDevice(deviceIDList []string, event string, message interface{}) (successList []string, failList []string, err error)
- func (socket *SocketioServer) SendEventToUser(userIDList []int64, deviceType string, event string, message interface{}) error
- func (socket *SocketioServer) SendNoticeToUser(userID int64, message interface{})
- func (server *SocketioServer) Warn(data any)
- type UserType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapH ¶
func WrapH(s *gosocketio.Server) http.HandlerFunc
Types ¶
type ConnectParam ¶
type ConnectParam struct { ID string `form:"id" json:"id" validate:"required"` //机器码 ConnID string `form:"-" json:"-"` Type string `form:"type" json:"type" validate:"oneof=web pad device wx"` Name string `form:"name" json:"name"` UserID string `form:"userID" json:"userID"` Conn gosocketio.Conn `form:"-" json:"-"` }
type RoomDescribe ¶
type RoomDescribeListResponse ¶
type RoomDescribeListResponse []RoomDescribe
type SocketioServer ¶
type SocketioServer struct { Socketio *gosocketio.Server FrontLoginInfoMap map[int64]map[string][]*ConnectParam //前端登录信息 // contains filtered or unexported fields }
socketio .....
func NewSocketioServer ¶
func NewSocketioServer(logger *zap.Logger) *SocketioServer
func (*SocketioServer) ClearRoomHandler ¶
func (serve *SocketioServer) ClearRoomHandler(room string)
func (*SocketioServer) Debug ¶
func (server *SocketioServer) Debug(data any)
func (*SocketioServer) Error ¶
func (server *SocketioServer) Error(data any)
func (*SocketioServer) Info ¶
func (server *SocketioServer) Info(data any)
func (*SocketioServer) JoinRoomHander ¶
func (serve *SocketioServer) JoinRoomHander(room string, f func(room string))
func (*SocketioServer) LeaveRoomHander ¶
func (serve *SocketioServer) LeaveRoomHander(room string, f func(userID int64, deviceID, deviceType, room string))
func (*SocketioServer) ListAllSocket ¶
func (socket *SocketioServer) ListAllSocket() (map[string]string, map[int64]map[string][]*ConnectParam)
func (*SocketioServer) ListRooms ¶
func (socket *SocketioServer) ListRooms() []RoomDescribe
ListRooms 返回所有的房间以及房间里的成员
func (*SocketioServer) NewID ¶
func (socket *SocketioServer) NewID() string
func (*SocketioServer) Run ¶
func (socket *SocketioServer) Run(httpServer *http.Server)
func (*SocketioServer) SendEventToDevice ¶
func (*SocketioServer) SendEventToUser ¶
func (socket *SocketioServer) SendEventToUser(userIDList []int64, deviceType string, event string, message interface{}) error
func (*SocketioServer) SendNoticeToUser ¶
func (socket *SocketioServer) SendNoticeToUser(userID int64, message interface{})
func (*SocketioServer) Warn ¶
func (server *SocketioServer) Warn(data any)
Click to show internal directories.
Click to hide internal directories.