add server api get and update service control endpoints

This commit is contained in:
Fran Jurmanović
2025-07-29 20:50:44 +02:00
parent 44acb170a7
commit 647f4f7487
27 changed files with 424 additions and 2025 deletions

View File

@@ -2,7 +2,9 @@ package main
import (
"acc-server-manager/local/utl/cache"
"acc-server-manager/local/utl/configs"
"acc-server-manager/local/utl/db"
"acc-server-manager/local/utl/jwt"
"acc-server-manager/local/utl/logging"
"acc-server-manager/local/utl/server"
"fmt"
@@ -10,10 +12,12 @@ import (
"go.uber.org/dig"
_ "acc-server-manager/docs"
_ "acc-server-manager/swagger"
)
func main() {
configs.Init()
jwt.Init()
// Initialize new logging system
if err := logging.InitializeLogging(); err != nil {
fmt.Printf("Failed to initialize logging system: %v\n", err)

27
cmd/api/swagger.go Normal file
View File

@@ -0,0 +1,27 @@
// Package main ACC Server Manager API
//
// @title ACC Server Manager API
// @version 1.0
// @description API for managing Assetto Corsa Competizione dedicated servers
//
// @contact.name ACC Server Manager Support
// @contact.url https://github.com/yourusername/acc-server-manager
//
// @license.name MIT
// @license.url https://opensource.org/licenses/MIT
//
// @host localhost:3000
// @BasePath /api/v1
// @schemes http https
//
// @securityDefinitions.apikey BearerAuth
// @in header
// @name Authorization
// @description Type "Bearer" followed by a space and JWT token.
//
// @externalDocs.description OpenAPI
// @externalDocs.url https://swagger.io/resources/open-api/
package main
// This file exists solely for Swagger documentation generation.
// Run: swag init -g cmd/api/swagger.go -o docs/