Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 1.68 KB

README.md

File metadata and controls

68 lines (50 loc) · 1.68 KB

QUIC Pub Sub

About

This project contains 3 services that communicate via QUIC:

  1. Server (in /server)
  2. Publisher (in /publisher)
  3. Subscriber (in /subscriber)
  • Publishers and Subscribers connect to the Server
  • Publishers send periodic messages to the Server if and only if there are subscribers connected to the Server
  • The Server sends out messages from Publishers to all connected Subscribers.

Running the apps

Generate TLS certificates before the first run:

bash gen_certs.sh

Build:

go build -o bin/server ./server
go build -o bin/publisher ./publisher
go build -o bin/subscriber ./subscriber

From the project root:

  1. build the server
./bin/server
  1. open publishers as subscribers from different shells:
./bin/publisher
./bin/subscriber

If the commands complain, run them with -help to see how to modify parameters.

Notes

Relationships

In each app:

  • Package transport contains code for remote communication and passes data onto the app package if one exists,
  • Package app contains the logical part of the server, excluding any data transport/RPC specifics.

Directories "internal"

Packages internal might not be necessary but they are here to signify (and enforce by the compiler) that code is not shared between each of the 3 services, as they all live in the same project. The code that is shared lives in pkg.

Loggers

Loggers are passed to constructors as arguments, not via Options, this is a todo.

Testing

go test ./...

Generate mocks if they need to change

go generate ./...