iwebsocket

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebSocketConnection

type WebSocketConnection struct {
	*websocket.Conn
}

------------------------------------------------------

------------------------------------------------------ WebSocketConnection is a wrapper for our websocket connection, in case we ever need to put more data into the struct

type WsClientPayload

type WsClientPayload struct {
	Action   string              `json:"action"`
	Username string              `json:"username"`
	Message  string              `json:"message"`
	Conn     WebSocketConnection `json:"-"`
}

WsPayload defines the websocket request from the client ------------------------------------------------------

payload from client to server

------------------------------------------------------

type WsServerPayload

type WsServerPayload struct {
	Action      string               `json:"action"`
	Message     string               `json:"message"`
	MessageType string               `json:"messagetype"`
	Data        any                  `json:"data"`
	Conn        *WebSocketConnection `json:"-"`
}

------------------------------------------------------

payload from server to client

------------------------------------------------------

Jump to

Keyboard shortcuts

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