Some checks failed
Go CI/CD Pipeline / Lint and Format (push) Successful in 4m51s
Docker Build and Publish / Version Bump (push) Successful in 4m54s
Docker Build and Publish / Build and Push Docker Image (push) Failing after 2m51s
Go CI/CD Pipeline / Build and Test (push) Successful in 9m47s
Go CI/CD Pipeline / Version Management (push) Successful in 12s
- Add swag fmt to git pre-commit hook and CI/CD pipeline - Create comprehensive CONTRIBUTING.md guide with AI section - Update ADR-0013 with swag fmt documentation - Fix swagger generation to include all endpoints - Improve local testing scripts and workflows - Update Dockerfile for better swagger handling - Fix CI/CD workflow file references
56 lines
1.3 KiB
Go
56 lines
1.3 KiB
Go
// Package main provides the DanceLessonsCoach server entry point
|
|
//
|
|
// @title DanceLessonsCoach API
|
|
// @version 1.1.1
|
|
// @description API for DanceLessonsCoach service providing greeting functionality
|
|
// @termsOfService http://swagger.io/terms/
|
|
|
|
// @contact.name API Support
|
|
// @contact.url http://www.arcodange.fr/support
|
|
// @contact.email support@arcodange.fr
|
|
|
|
// @license.name MIT
|
|
// @license.url https://opensource.org/licenses/MIT
|
|
|
|
// @host localhost:8080
|
|
// @BasePath /api
|
|
// @schemes http https
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
"DanceLessonsCoach/pkg/config"
|
|
"DanceLessonsCoach/pkg/server"
|
|
"DanceLessonsCoach/pkg/version"
|
|
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
func main() {
|
|
// Check for version flag first (before config loading)
|
|
if len(os.Args) > 1 && (os.Args[1] == "--version" || os.Args[1] == "-version") {
|
|
fmt.Println(version.Full())
|
|
os.Exit(0)
|
|
}
|
|
|
|
// Load configuration (this will also setup logging)
|
|
cfg, err := config.LoadConfig()
|
|
if err != nil {
|
|
log.Fatal().Err(err).Msg("Failed to load configuration")
|
|
}
|
|
|
|
// Create readiness context to control readiness state
|
|
readyCtx, readyCancel := context.WithCancel(context.Background())
|
|
defer readyCancel()
|
|
|
|
// Create and run server
|
|
server := server.NewServer(cfg, readyCtx)
|
|
if err := server.Run(); err != nil {
|
|
log.Fatal().Err(err).Msg("Server failed")
|
|
}
|
|
}
|