messages

package
v0.0.0-...-06e8c3e Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenForClientMessage

func ListenForClientMessage(conn *websocket.Conn) (string, string, []byte, error)

ListenForClientMessage listens for client messages and returns the received message action and payload

func SendMessageToClient

func SendMessageToClient(conn *websocket.Conn, action, reqID string, payload interface{}) error

SendMessageToClient wraps a message action and payload in a Message structure and sends it to the client

Types

type Message

type Message struct {
	Action  string      `json:"action"`
	Payload interface{} `json:"body"`
	ReqID   string      `json:"reqid"`
}

Jump to

Keyboard shortcuts

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