juanatsap
4528e04bad
feat: Complete all remaining Future Improvements (#4-8)
...
Implemented 5 additional architectural improvements:
1. Response Types (types.go)
- APIResponse with Success, Data, Error, Meta fields
- ErrorInfo with Code, Message, Field, Details
- MetaInfo with Timestamp, Version, RequestID
- SuccessResponse() and NewErrorResponse() helpers
- HealthCheckResponse for health endpoint
- Consistent JSON API responses
2. Validation Tags (types.go)
- Added struct tags to LanguageRequest
- Added struct tags to PDFExportRequest
- Declarative validation rules (oneof, required)
- Self-documenting validation constraints
- Ready for go-playground/validator integration
3. Context Helper Functions (middleware/preferences.go)
- GetLanguage(), GetCVLength(), GetCVIcons(), GetCVTheme(), GetColorTheme()
- IsLongCV(), IsShortCV() boolean helpers
- ShowIcons(), HideIcons() boolean helpers
- IsCleanTheme(), IsDefaultTheme() boolean helpers
- IsDarkMode(), IsLightMode() boolean helpers
- 13 new convenience functions for cleaner code
4. Typed Errors (errors.go)
- ErrorCode constants for all error types
- DomainError with Code, Message, Err, StatusCode, Field
- Unwrap() support for error chains
- WithError() and WithField() fluent builders
- InvalidLanguageError(), InvalidLengthError(), etc.
- PDFGenerationError(), MethodNotAllowedError(), RateLimitError()
- 13 error codes, domain-specific constructors
5. Benchmark Tests
- handlers/benchmarks_test.go (11 benchmarks)
- middleware/benchmarks_test.go (12 benchmarks)
- Sequential benchmarks for handlers, middleware, request parsing
- Parallel benchmarks for concurrent load testing
- Response creation benchmarks
- Helper function benchmarks
Benefits:
- Type Safety: Validation tags and structured types
- Developer Experience: 13 context helpers reduce boilerplate
- Error Handling: Domain-specific errors with codes
- Performance Monitoring: 23 benchmarks for regression detection
- API Consistency: Standardized response formats
- Maintainability: Self-documenting validation and errors
Testing:
- All unit tests pass
- All benchmarks working
- Build succeeds
- No breaking changes
2025-11-20 18:05:45 +00:00
juanatsap
dab68f34f2
Initial commit: Go + HTMX CV Site
...
- Minimal, professional CV design with paper-on-gray layout
- Bilingual support (Spanish/English) with HTMX language switching
- JSON-based content management (cv-en.json, cv-es.json)
- Print-optimized CSS for PDF export
- Responsive design for all devices
- Go backend with stdlib net/http
- Clean, maintainable codebase
Features:
- 18+ years professional experience
- SAP CDC expertise
- Complete project history
- Education, certifications, awards
- Multi-language support
Tech stack: Go, HTMX, vanilla CSS
2025-10-20 08:54:21 +01:00