safe_ws

package
v0.0.0-...-94da729 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeWebSocket

type SafeWebSocket struct {
	Conn          *websocket.Conn
	SendChannel   chan *WebSocketSendingMessage
	OnRecvMessage func(ws *SafeWebSocket, messageType int, data []byte)
	OnClose       func()
}

safe websocket

func NewSafeWebSocket

func NewSafeWebSocket(conn *websocket.Conn, OnRecvMessage func(ws *SafeWebSocket, messageType int, data []byte), onClose func()) *SafeWebSocket

func (*SafeWebSocket) Close

func (ws *SafeWebSocket) Close()

func (*SafeWebSocket) Send

func (ws *SafeWebSocket) Send(messageType int, data []byte) (e error)

type WebSocketSendingMessage

type WebSocketSendingMessage struct {
	MessageType int
	Data        []byte
}

Jump to

Keyboard shortcuts

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