refactor: reorganize struct fields, add new handlers and storage backends

- [x] Reorder struct fields across codebase for consistency
- [x] Add analytics event handlers and tests
- [x] Add authentication API key management handlers and tests
- [x] Add pre-warming control handlers and tests
- [x] Implement S3 storage backend with tests
- [x] Implement SMB/CIFS storage backend with tests
- [x] Add CDN middleware tests
- [x] Integrate analytics tracking into cache manager
- [x] Add S3 and SMB storage initialization in app setup
- [x] Add CDN caching to proxy handlers
- [x] Remove distributed locking (Redis lock manager)
- [x] Remove proxy common package and utilities
- [x] Remove standalone HTTP server package
- [x] Remove logger middleware
- [x] Simplify error handling utilities
- [x] Update config with S3 and SMB options
- [x] Update cache manager signature to include analytics
This commit is contained in:
2026-01-03 00:18:58 +00:00
parent 48b834a62a
commit 6b037a92b4
57 changed files with 2789 additions and 2276 deletions
-25
View File
@@ -137,21 +137,11 @@ func RecordCacheMiss(handler string) {
CacheRequests.WithLabelValues("miss", handler).Inc()
}
// RecordCacheError records a cache error
func RecordCacheError(handler string) {
CacheRequests.WithLabelValues("error", handler).Inc()
}
// UpdateCacheSize updates the cache size metric
func UpdateCacheSize(backend string, bytes int64) {
CacheSizeBytes.WithLabelValues(backend).Set(float64(bytes))
}
// UpdateCacheItems updates the cache items metric
func UpdateCacheItems(handler string, count int64) {
CacheItemsTotal.WithLabelValues(handler).Set(float64(count))
}
// RecordCacheEviction records a cache eviction
func RecordCacheEviction(reason string) {
CacheEvictions.WithLabelValues(reason).Inc()
@@ -162,26 +152,11 @@ func RecordStorageOperation(backend, operation, status string) {
StorageOperations.WithLabelValues(backend, operation, status).Inc()
}
// UpdateStorageQuota updates the storage quota metric
func UpdateStorageQuota(project string, bytes int64) {
StorageQuotaBytes.WithLabelValues(project).Set(float64(bytes))
}
// RecordUpstreamRequest records an upstream request
func RecordUpstreamRequest(registry, status string) {
UpstreamRequests.WithLabelValues(registry, status).Inc()
}
// RecordSecurityScan records a security scan
func RecordSecurityScan(scanner, result string) {
SecurityScans.WithLabelValues(scanner, result).Inc()
}
// RecordVulnerability records a vulnerability finding
func RecordVulnerability(severity string) {
VulnerabilitiesFound.WithLabelValues(severity).Inc()
}
// UpdateCircuitBreakerState updates the circuit breaker state
func UpdateCircuitBreakerState(name string, state int) {
CircuitBreakerState.WithLabelValues(name).Set(float64(state))