Feature/ci docs polish#14
Merged
Merged
Conversation
…out middleware - Add golangci linter configuration with 19 enabled linters for code quality checks - Implement timeout middleware to enforce request deadline limits - Implement security headers middleware (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, etc.) - Implement CORS middleware with configurable allowed origins and methods - Implement rate limiting middleware using Redis with per-IP request tracking - Add rate limit configuration to Config struct (RequestTimeout, AllowedOrigins, RateLimitRequests, RateLimitWindow) - Update router setup to apply all middleware in correct order - Add gin-contrib/cors dependency to go.mod - Add i18n message code for rate limit exceeded error - Update English and Farsi i18n translations with new error messages
… optimizations - Refactor health check endpoint to include dependency status checks for Postgres, Redis, and Elasticsearch - Add HealthHandler struct with dependency injection for db, redis, elasticsearch clients - Update health check response to include version, app name, and individual service status - Add HTTP status codes based on health state (200/206/503) - Add REQUEST_TIMEOUT, ALLOWED_ORIGINS, RATE_LIMIT_REQUESTS, and RATE_LIMIT_WINDOW
- Add architecture.md documenting layered architecture, request lifecycle, and error propagation - Add CI workflow badge to README - Add Redis badge to README technology stack - Document middleware chain execution order and two API surface patterns
…outer files - Convert spaces to tabs in backoffice_router.go, portal_router.go, and router.go - Fix indentation in configs package files (config.go, db.go, redis.go) - Standardize indentation in domain test files (book_dom_test.go, customer_dom_test.go, query_test.go) - Remove trailing whitespace and extra blank lines - Fix struct field alignment in domain files (customer_dom.go, employee_dom.go, query.go) - Align import statements formatting
- Update godot linter configuration to exclude lines starting with '@' - Change comment style from `// Section` to `// Section.` in error codes - Change comment style from `// Section` to `// Section.` in i18n message codes - Change comment style from `// Section` to `// Section.` in i18n error mapping - Remove redundant "Mock repository" and "Mock password hasher" comments from test files
…rsing - Rename `SearchParams` to `Params` and `SearchResult` to `Result` in search package - Add error handling for `fmt.Sscanf` in `getEnvInt` with fallback on parse failure - Replace unused context parameters with underscore in test mock functions - Update all references to renamed search types in handlers and tests
…iles - Replace `ctx context.Context` with `_ context.Context` in mock repository methods - Replace `id string`, `email string`, `mobile string`, `input domain.*Input` with underscored parameters in unused mock functions - Add context import to middleware_test.go for http.NewRequestWithContext - Update all http.NewRequest calls to http.NewRequestWithContext in middleware tests - Remove explanatory comments from test files (section
… usage - Add TestMockCustomerRepoForAuth_Used to validate mock repository integration - Test login flow using mockCustomerRepoForAuth with onGetByEmail callback - Verify HTTP 200 response for successful authentication request
- Replace full integration test with mock method verification in customer_auth_handler_test.go - Skip health check test when infrastructure dependencies are unavailable - Add ISBN field to book creation in borrow flow test to satisfy unique constraint - Add retry logic with backoff for database ping to handle postgres initialization delay - Fix migration URL construction using strings.Replace instead of manual substring - Remove book_requests from cleanup tables truncate statement
…lp documentation - Add VERSION variable to Makefile using git describe with fallback to "dev" - Add LDFLAGS variable for consistent version injection across build targets - Update run-api and build-api targets to use LDFLAGS for version embedding - Add Version variable to main.go with "dev" default value - Update startup log to include version information - Add tidy target to .PHONY declaration - Refactor help target to show categorized command documentation instead of parsing comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.