websockets

package
v0.0.0-...-fdbb991 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Clients = make(map[string]Client)

Functions

func NotificationSend

func NotificationSend(data jsonMap, recID string)

send message to a receiver

func NotificationsDatabaseGet

func NotificationsDatabaseGet(userID string)

get all messages for user from database

func Socket

func Socket(w http.ResponseWriter, r *http.Request)

Types

type Client

type Client struct {
	Conn *websocket.Conn
	Page string
}

type Message

type Message struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
	UserID   string `json:"userID"`
	Text     string `json:"text"`
	Date     string `json:"date"`
}

Jump to

Keyboard shortcuts

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