ws

package
v0.0.0-...-7578c0e Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentWebSocket

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

func NewConcurrentWebSocket

func NewConcurrentWebSocket(conn Conn, log *logger.Logger) *ConcurrentWebSocket

func (*ConcurrentWebSocket) Close

func (ws *ConcurrentWebSocket) Close() error

func (*ConcurrentWebSocket) ReadJSON

func (ws *ConcurrentWebSocket) ReadJSON(inboundMsg interface{}) error

func (*ConcurrentWebSocket) ReadMessage

func (ws *ConcurrentWebSocket) ReadMessage() (messageType int, p []byte, err error)

func (*ConcurrentWebSocket) SetWritesBeforeClose

func (ws *ConcurrentWebSocket) SetWritesBeforeClose(n int)

func (*ConcurrentWebSocket) WriteError

func (ws *ConcurrentWebSocket) WriteError(title string, err error)

func (*ConcurrentWebSocket) WriteJSON

func (ws *ConcurrentWebSocket) WriteJSON(jsonOutboundMsg interface{}) error

WriteJSON write json message to websocket, counting towards writes before close

func (*ConcurrentWebSocket) WriteMessage

func (ws *ConcurrentWebSocket) WriteMessage(messageType int, data []byte) error

func (*ConcurrentWebSocket) WriteNonFinalJSON

func (ws *ConcurrentWebSocket) WriteNonFinalJSON(jsonOutboundMsg interface{}) error

WriteNonFinalJSON write json message to websocket, not counting towards writes before close

type Conn

type Conn interface {
	NextReader() (messageType int, r io.Reader, err error)
	ReadMessage() (messageType int, p []byte, err error)
	WriteMessage(messageType int, data []byte) error
	WriteJSON(v interface{}) error
	Close() error
}

type WebSocketCache

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

func NewWebSocketCache

func NewWebSocketCache() WebSocketCache

func (*WebSocketCache) CloseConnections

func (c *WebSocketCache) CloseConnections() error

func (*WebSocketCache) Delete

func (c *WebSocketCache) Delete(key string)

func (*WebSocketCache) Get

func (*WebSocketCache) Set

func (c *WebSocketCache) Set(key string, ws *ConcurrentWebSocket)

Jump to

Keyboard shortcuts

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