Contents
PubSub is a TCP-based Pub/Sub server. It lets clients create/listen to topics and data that is published to specific topics by other clients.
For more on how this project works, visit my portfolio.
Clone this repository.
git clone https://github.com/Sidney-Bernardin/PubSub.git
cd PubSub
Then run directly on your machine or with Docker.
go run . -addr=0.0.0.0:8080
You can use the pre-built image that's based on the Dockerfile at the root of this repository.
docker run -p 8080:8080 sidneybernardin/pubsub:latest
Using a TCP client of your choice (like Telnet), you can send two types of commands to the server.
To create and listen to topics, use a subscribe command.
sub topic_a topic_b topic_c
To publish data to topics, use a publish command.
pub topic_a Hello, World!
All errors are returned in a JSON format and are easy to parse.
{"type":"invalid_command","detail":"Operation 'pub' requires a topic and topic-message as arguments."}