This application serves as a data manager for PUBG (PlayerUnknown's Battlegrounds) leaderboard statistics. It provides services to load leaderboard data into Redis, backup data to MinIO, and restore from MinIO.
- Load current PUBG leaderboard data into Redis.
- Periodically refresh leaderboard data from the PUBG API.
- Backup leaderboard data to MinIO object storage.
- Restore leaderboard data from MinIO into Redis.
- Provide a RESTful API to interact with the service.
- Go (version 1.15 or higher)
- Redis server
- MinIO server
- Access to PUBG API with an API key
- Clone the repository to your local machine:
git clone https://github.com/your-username/pubg-leaderboard.git
- Navigate into the project directory:
cd pubg-leaderboard
- Build the application:
go build -o pubg-leaderboard
docker build -t pubg-leaderboard:latest .
Before running the application, configure the necessary environment variables or config.json
file with the following settings:
REDIS_ADDR
: The address of your Redis server.MINIO_ENDPOINT
: The endpoint for your MinIO server.MINIO_ACCESS_KEY
: Your MinIO access key.MINIO_SECRET_KEY
: Your MinIO secret key.PUBG_API_KEY
: Your API key for the PUBG API.
After configuration, you can start the application by running:
./pubg-leaderboard
The application exposes the following RESTful endpoints:
GET /ping
: Health check for the application.GET /redis-ping
: Check the connection to the Redis server.GET /current-season
: Get the current PUBG season data.GET /current-leaderboard
: Get the current PUBG leaderboard.GET /player-stats/:playerID
: Get specific stats for a player by their ID.POST /backup-leaderboard
: Backup the current leaderboard to MinIO.POST /restore-leaderboard
: Restore the leaderboard from a MinIO backup.
If you'd like to contribute to the project, please fork the repository and use a feature branch. Pull requests are warmly welcome.
Feel free to contact project maintainers for any inquiries ([email protected]).