This project contains 3 services that communicate via QUIC:
- Server (in
/server
) - Publisher (in
/publisher
) - 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.
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:
- build the server
./bin/server
- 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.
In each app:
- Package
transport
contains code for remote communication and passes data onto theapp
package if one exists, - Package
app
contains the logical part of the server, excluding any data transport/RPC specifics.
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 are passed to constructors as arguments, not via Options, this is a todo.
go test ./...
Generate mocks if they need to change
go generate ./...