notify

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSubscriber

func AddSubscriber() chan string

Function to add a subscriber (client waiting for an event)

func AddWebSocketConnection added in v0.0.4

func AddWebSocketConnection(conn *websocket.Conn, username string)

AddWebSocketConnection adds a WebSocket connection to receive notifications

func RemoveSubscriber

func RemoveSubscriber(ch chan string)

Function to remove a subscriber

func RemoveWebSocketConnection added in v0.0.4

func RemoveWebSocketConnection(conn *websocket.Conn)

RemoveWebSocketConnection removes a WebSocket connection

func SendToAllUsers added in v0.0.4

func SendToAllUsers(conn *sqlite.Conn, message string) error

SendToAllUsers sends a notification to all users

Types

type Notice

type Notice struct {
	Message string `json:"message"`
	Status  string `json:"status"`
}

type Notification added in v0.0.4

type Notification struct {
	ID        int64  `json:"id"`
	Username  string `json:"username,omitempty"`
	Message   string `json:"message"`
	IsRead    bool   `json:"is_read"`
	CreatedAt string `json:"created_at"`
}

Jump to

Keyboard shortcuts

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