Commit Graph

9 Commits

Author SHA1 Message Date
b279a31f88 feat: implement OpenAPI/Swagger documentation with swaggo/swag
📝 docs: add comprehensive API documentation
📦 dependencies: add swaggo/swag to go.mod
🔧 chore: add go:generate directive for documentation

- Add comprehensive API documentation using swaggo/swag
- Embed OpenAPI spec in binary using go:embed
- Add Swagger UI at /swagger/
- Document all endpoints, models, and validation rules
- Add go:generate directive for easy regeneration
- Update README, AGENTS, CHANGELOG with documentation
- Finalize ADR 0013 with implementation details
- Gitignore generated docs directory

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-05 00:45:40 +02:00
371dee01d5 📦 chore: update dependencies with go mod tidy
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-04-04 21:14:07 +02:00
d3b6d190d1 feat: implement input validation for API v2
- Added go-playground/validator dependency

- Created pkg/validation/ package with custom validator wrapper

- Implemented request validation for v2 greet endpoint

- Added structured validation error responses

- Extended BDD tests to cover validation scenarios

- Updated AGENTS.md with v2 API documentation

- Created ADR 0011-validation-library-selection.md

- Simplified server handler creation code

- Updated CHANGELOG with implementation details
2026-04-04 21:08:13 +02:00
0daaf9bf96 feat: implement BDD testing with Godog
Implement comprehensive BDD testing framework using Godog:
- Added feature files for greet and health endpoints
- Created test server that runs on port 9191
- Implemented step definitions using Godog's exact patterns
- Fixed undefined step warnings by following Godog conventions
- All tests passing with proper response validation
- Maintained black box testing principles

Key files:
- pkg/bdd/steps/steps.go - Step definitions using StepContext struct
- pkg/bdd/testserver/ - Test server implementation
- features/*.feature - BDD feature files
- pkg/bdd/README.md - Documentation for proper step patterns

The implementation follows Godog's exact pattern suggestions to avoid
undefined step warnings and provides comprehensive API testing.
2026-04-04 17:43:57 +02:00
Mistral Vibe
36f0b79b90 Add OpenTelemetry instrumentation with middleware-only approach 2026-04-04 12:19:48 +02:00
Gabriel Radureau
8103f64db9 Add configuration management with Viper
- Implement pkg/config package with Viper integration
- Support environment variables with DLC_ prefix
- Add configurable server host, port, and shutdown timeout
- Update server to use configuration values
- Add config.example.yaml template file
- Update AGENTS.md with configuration documentation
- Maintain backward compatibility with default values

Configuration options:
- DLC_SERVER_HOST (default: 0.0.0.0)
- DLC_SERVER_PORT (default: 8080)
- DLC_SHUTDOWN_TIMEOUT (default: 30s)
2026-04-03 13:53:57 +02:00
Gabriel Radureau
e52870480d Enhance server with context initialization and graceful shutdown
- Added context-aware server initialization in cmd/server/main.go
- Implemented graceful shutdown handling with SIGINT/SIGTERM signals
- Added 30-second shutdown timeout for active connections
- Updated Greet service to use context.Context as first parameter
- Enhanced Zerolog integration with Trace level logging
- Added context-aware logging in Greet function calls
- Fixed route structure to use /api/v1/greet/* prefix
- Updated all handlers and tests to use context
- Comprehensive AGENTS.md documentation with verified commands
- Added server context management architecture section
- Updated API endpoint documentation with working examples

Changes:
- cmd/server/main.go: Complete rewrite with context and graceful shutdown
- pkg/greet/greet.go: Added context parameter and trace logging
- pkg/greet/api_v1.go: Updated interface and handlers for context
- pkg/greet/greet_test.go: Updated tests to use context
- cmd/greet/main.go: Updated CLI to use context
- pkg/server/server.go: Trace level config and context logging
- AGENTS.md: Comprehensive documentation update
- go.mod/go.sum: Added Zerolog dependency

All tests passing, server working with graceful shutdown verified.
2026-04-03 13:39:50 +02:00
Gabriel Radureau
6365f92359 Refactor to JSON API with Chi router and interface-based design
- Add pkg/greet/api_v1.go with ApiV1Greet interface and handler
- Implement Greeter interface for dependency injection
- Return JSON responses with proper Content-Type headers
- Move greet service instantiation to server package
- Separate v1 route registration into registerApiV1Routes function
- Health endpoint at /api level, greet endpoints at /api/v1/greet
- Simplify server entrypoint by removing external dependencies
2026-04-03 13:04:33 +02:00
Gabriel Radureau
3efc1992d5 Initial commit: Go project with greet function and CLI 2026-04-03 12:20:55 +02:00