notify

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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