websocket

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventsRoute = websocket.New(func(c *websocket.Conn) {
	registerWebsocketConnection(c)

	var err error
	for {
		_, _, err = c.ReadMessage()
		if err != nil {
			break
		}
	}

	if !unregisterWebsocketConnection(c) {
		log.Println("Was unable to close websocket connection, this should not happen and is a bug")
	}
})

Functions

func SendBytes

func SendBytes(payload []byte)

func SendJSON

func SendJSON(data interface{})

func SendMessage

func SendMessage(message models.Message)

func SendString

func SendString(payload string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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