handler

package
v0.0.0-...-e0866c7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefWsHandler

type DefWsHandler struct {
	// contains filtered or unexported fields
}

func NewDefWsHandler

func NewDefWsHandler(cfg *ws.WsConfig) *DefWsHandler

func (*DefWsHandler) Broadcast

func (wsh *DefWsHandler) Broadcast(data []byte) error

全部发送

func (*DefWsHandler) Connect

func (wsh *DefWsHandler) Connect(w http.ResponseWriter, r *http.Request)

链接

func (*DefWsHandler) ConnectGin

func (wsh *DefWsHandler) ConnectGin(c *gin.Context)

基于gin的链接

func (*DefWsHandler) Disconnect

func (wsh *DefWsHandler) Disconnect(wsc *ws.WsChannal) error

断开链接

func (*DefWsHandler) GetConfig

func (wsh *DefWsHandler) GetConfig() *ws.WsConfig

func (*DefWsHandler) Heartbeat

func (wsh *DefWsHandler) Heartbeat(wsc *ws.WsChannal) error

心跳

func (*DefWsHandler) MsgHandler

func (wsh *DefWsHandler) MsgHandler(wsc *ws.WsChannal, msg *ws.Msg)

读取消息处理

func (*DefWsHandler) Send

func (wsh *DefWsHandler) Send(deviceId string, data []byte) error

单个发送消息

func (*DefWsHandler) SendToGroup

func (wsh *DefWsHandler) SendToGroup(groupId string, data []byte) error

发送组内消息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL