mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(api): add feature flag management endpoints
Add FeatureHandler to manage lightweight runtime configuration toggles stored in the Redis `meta:features` hash. This enables dynamic control over system behavior (e.g., storage backends) via the admin API. - Add `GET /admin/features` to list flags - Add `PUT /admin/features` to update flags - Update README with feature flag documentation
This commit is contained in:
@@ -113,6 +113,7 @@ func main() {
|
||||
handler := api.NewHandler(db, syncService, logWriter)
|
||||
adminHandler := api.NewAdminHandler(masterService, syncService)
|
||||
masterHandler := api.NewMasterHandler(masterService, syncService)
|
||||
featureHandler := api.NewFeatureHandler(rdb)
|
||||
|
||||
// 4.1 Prime Redis snapshots so DP can start with data
|
||||
if err := syncService.SyncAll(db); err != nil {
|
||||
@@ -157,6 +158,8 @@ func main() {
|
||||
adminGroup.Use(middleware.AdminAuthMiddleware(adminService))
|
||||
{
|
||||
adminGroup.POST("/masters", adminHandler.CreateMaster)
|
||||
adminGroup.GET("/features", featureHandler.ListFeatures)
|
||||
adminGroup.PUT("/features", featureHandler.UpdateFeatures)
|
||||
// Other admin routes for managing providers, models, etc.
|
||||
adminGroup.POST("/providers", handler.CreateProvider)
|
||||
adminGroup.POST("/models", handler.CreateModel)
|
||||
|
||||
Reference in New Issue
Block a user