websocketcontroller

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

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