gatekeeper

module
v0.0.2-0...-8a457a3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2025 License: MPL-2.0

README

Go Reference

The main idea is to decouple core application logic from WebSocket connection
management, enabling multiple modular instances to publish events to a central server.

Gatekeeper doesn't know who processes events and how, or whether anyone processes
them at all. Its sole responsibility is to accept and forward events from a large
number of concurrently connected clients.

The central server performs the heavy lifting: updating its internal state,
optionally accessing the database, and publishing responses back to a RabbitMQ
exchange. These responses are then consumed by the corresponding room, maintained
by the Gatekeeper.

Architecture

Architecture

Local installation

First install the Go compiler version 1.24.4 or newer (see https://go.dev/dl).

You will also need a RabbitMQ server instance up and running
(see https://www.rabbitmq.com/docs/download).

Once everything is installed, clone this repository:

git clone https://github.com/treepeck/gatekeeper
cd gatekeeper

Gatekeeper uses environment variables to specify the RabbitMQ connection URL and
the port on which it will listen for WebSocket connections. Here is an example of how
to create and populate a .env file in the gatekeeper folder:

touch .env
echo "RABBITMQ_URL=amqp://guest:guest@localhost:5672/" >> .env
echo "ADDR=:3503" >> .env

Run this command to start the server:

go run cmd/gatekeeper/main.go

License

Copyright (c) 2025 Artem Bielikov

This project is available under the Mozilla Public License, v. 2.0.
See the LICENSE file for details.

Directories

Path Synopsis
cmd
gatekeeper command
internal
ws
pkg
env
event
Package event defines event types.
Package event defines event types.
mq
Package mq containts helper functions to make the work with RabbitMQ easier.
Package mq containts helper functions to make the work with RabbitMQ easier.

Jump to

Keyboard shortcuts

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