Documentation ¶
Index ¶
- type Controller
- func (c *Controller) Connect() error
- func (c *Controller) ConnectReady(connect *websocket.Conn)
- func (c *Controller) Disconnect()
- func (c *Controller) GetExtData(key any) (any, bool)
- func (c *Controller) GetRemoteAddr() string
- func (c *Controller) ScureSkipVerify(b bool)
- func (c *Controller) SendMessage(messageBytes []byte)
- func (c *Controller) SetConnectRetry(b bool)
- func (c *Controller) SetConnectRetryCount(count int)
- func (c *Controller) SetConnectRetryInterval(t time.Duration)
- func (c *Controller) SetReadDeadline(d time.Duration)
- func (c *Controller) SetReceiveMessageDecryptionFunc(f func(messageBytes []byte) ([]byte, error))
- func (c *Controller) SetSendMessageEncryptionFunc(f func(messageBytes []byte) ([]byte, error))
- func (c *Controller) SetServerURL(url string)
- func (c *Controller) StoreExtData(key any, data any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { Logs *logrus.Logger ReceiveMessageCallback func(c *Controller, messageBytes []byte) //接收消息回调函数 ClientReadyCallback func(c *Controller) ClientDisconnectedCallback func(c *Controller) // contains filtered or unexported fields }
func (*Controller) Connect ¶
func (c *Controller) Connect() error
func (*Controller) ConnectReady ¶
func (c *Controller) ConnectReady(connect *websocket.Conn)
ConnectReady Websocket 服务器端使用
func (*Controller) Disconnect ¶
func (c *Controller) Disconnect()
func (*Controller) GetExtData ¶
func (c *Controller) GetExtData(key any) (any, bool)
func (*Controller) GetRemoteAddr ¶
func (c *Controller) GetRemoteAddr() string
func (*Controller) ScureSkipVerify ¶
func (c *Controller) ScureSkipVerify(b bool)
func (*Controller) SendMessage ¶
func (c *Controller) SendMessage(messageBytes []byte)
func (*Controller) SetConnectRetry ¶
func (c *Controller) SetConnectRetry(b bool)
func (*Controller) SetConnectRetryCount ¶
func (c *Controller) SetConnectRetryCount(count int)
func (*Controller) SetConnectRetryInterval ¶
func (c *Controller) SetConnectRetryInterval(t time.Duration)
func (*Controller) SetReadDeadline ¶
func (c *Controller) SetReadDeadline(d time.Duration)
func (*Controller) SetReceiveMessageDecryptionFunc ¶
func (c *Controller) SetReceiveMessageDecryptionFunc(f func(messageBytes []byte) ([]byte, error))
func (*Controller) SetSendMessageEncryptionFunc ¶
func (c *Controller) SetSendMessageEncryptionFunc(f func(messageBytes []byte) ([]byte, error))
func (*Controller) SetServerURL ¶
func (c *Controller) SetServerURL(url string)
func (*Controller) StoreExtData ¶
func (c *Controller) StoreExtData(key any, data any)
Click to show internal directories.
Click to hide internal directories.