pg_notify_sample

command module
v0.0.0-...-266a385 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 15 Imported by: 0

README

pg_notify_sample

Example of real-time messaging using Go, PostgreSQL LISTEN/NOTIFY, and WebSocket.

Overview

Overview

Usage

Use websocat as WebSocket client.

# launch
docker compose up
go run .
# Alice
websocat 'ws://localhost:8080/ws?room_id=e5c87218-676b-4185-9335-3fe48eff6a38'
{"foo", "bar"} # send JSON message
# Bob
websocat 'ws://localhost:8080/ws?room_id=e5c87218-676b-4185-9335-3fe48eff6a38'
# {"foo", "bar"} # receive JSON message

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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