A simple game log management system built with Go and Gin framework. The system currently focuses on collecting and displaying login errors.
- Collection of login errors from games
- Web interface for viewing and managing login error logs
- SQLite database for data storage
- RESTful API for integration with game clients
- Backend: Go with Gin framework
- Database: SQLite
- Frontend: HTML, CSS, JavaScript with Bootstrap
game_log_hub/
├── api/ # API routes and handlers
├── config/ # Configuration files
├── controllers/ # Request handlers
├── database/ # Database connection and models
├── middleware/ # HTTP middleware
├── models/ # Data models
├── public/ # Static files for frontend
├── utils/ # Utility functions
├── main.go # Application entry point
└── go.mod # Go module definition
GET /api/login-errors
- Get a paginated list of login errorsGET /api/login-errors/:id
- Get a specific login error by IDPOST /api/login-errors/
- Create a new login error record (note the trailing slash)DELETE /api/login-errors/:id
- Delete a login error record
- Clone the repository
- Build the application:
go build -o game_log_hub
- Run the application:
./game_log_hub
- Access the web interface at http://localhost:8080
To set up Game Log Hub as a system service that starts automatically on boot:
-
Build the application:
go build -o game_log_hub
-
Create a systemd service file:
sudo cp game_log_hub.service /etc/systemd/system/ sudo systemctl daemon-reload
-
Enable and start the service:
sudo systemctl enable game_log_hub.service sudo systemctl start game_log_hub.service
-
Check service status:
sudo systemctl status game_log_hub.service
-
Service management commands:
# Stop the service sudo systemctl stop game_log_hub.service # Restart the service sudo systemctl restart game_log_hub.service # View logs sudo journalctl -u game_log_hub.service
Creating a login error record:
curl -X POST http://192.168.1.200:8080/api/login-errors/ -H "Content-Type: application/json" -d '{
"user_id": "12345",
"user_name": "player123",
"error_type": "authentication_failed",
"error_msg": "Invalid username or password",
"ip": "192.168.1.100",
"platform": "Windows",
"device": "Desktop"
}'