websocket

package
v0.0.0-...-17e35b8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WebSocketConnections map[*WebSocketConnection]bool

Functions

func ActivateSocket

func ActivateSocket(connection *WebSocketConnection)

func BroadcastMessageToWebSockets

func BroadcastMessageToWebSockets(message mailitem.MailItem)

This function takes a MailItem and sends it to all open websockets.

func DestroyConnection

func DestroyConnection(connection *WebSocketConnection)

Types

type WebSocketConnection

type WebSocketConnection struct {
	// Websocket connection handle
	WS *ws.Conn

	// Buffered channel for outbound messages
	SendChannel chan mailitem.MailItem
}

Structure for tracking and working with websockets

Jump to

Keyboard shortcuts

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