Soldank++ JSON API based lobby server. Enables registering and discovering all registered Soldank++ servers.
The lobby removes servers after 5 minutes unless they re-register.
HTTP Method | Endpoint | Returned type | Description |
---|---|---|---|
GET | /servers |
List<Server> | Returns a list of all registered servers. |
GET | /servers/:ip/:port |
Server | Returns information about a server specified by the given ip and port . |
GET | /servers/:ip/:port/players |
List | Returns a list of players of a server specified by the given ip and port . |
POST | /servers |
Empty | Registers a new server. Requires RegisterServerInput as request's body. |
The program expects a file app.env
to be created and filled with all the required environment variables. See example.env
The project uses the following packages:
- Gin Web Framework - Framework that handles http connections
- Viper - Helps define and read environment variables
- TreeMap v2 - Tree-based set data structure that helps manage the list of registered servers
To build a binary run:
go build
The above command should create spp-lobby
file.
Run the lobby in release mode:
GIN_MODE=release ./spp-lobby
To run all tests run command:
go test