Skip to content

Soldank++ JSON API based lobby server

License

Notifications You must be signed in to change notification settings

rzaba0/spp-lobby

 
 

Repository files navigation

Soldank++ Lobby

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.

Endpoints

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.

Environment variables

The program expects a file app.env to be created and filled with all the required environment variables. See example.env

Dependencies

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

Building

To build a binary run:

go build

The above command should create spp-lobby file.

Running

Run the lobby in release mode:

GIN_MODE=release ./spp-lobby

Testing

To run all tests run command:

go test

About

Soldank++ JSON API based lobby server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%