{"id":31895760,"url":"https://github.com/hantdev/chorus-controller","last_synced_at":"2025-10-13T10:51:16.070Z","repository":{"id":315403173,"uuid":"1044004966","full_name":"hantdev/chorus-controller","owner":"hantdev","description":"Chorus Controller for Data Sync Service ","archived":false,"fork":false,"pushed_at":"2025-09-18T10:32:34.000Z","size":85300,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-18T12:41:07.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hantdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-25T03:39:25.000Z","updated_at":"2025-09-18T10:32:39.000Z","dependencies_parsed_at":"2025-09-18T12:51:23.634Z","dependency_job_id":null,"html_url":"https://github.com/hantdev/chorus-controller","commit_stats":null,"previous_names":["hantdev/chorus-controller"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/hantdev/chorus-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hantdev%2Fchorus-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hantdev%2Fchorus-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hantdev%2Fchorus-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hantdev%2Fchorus-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hantdev","download_url":"https://codeload.github.com/hantdev/chorus-controller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hantdev%2Fchorus-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014645,"owners_count":26085556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-13T10:51:14.950Z","updated_at":"2025-10-13T10:51:16.057Z","avatar_url":"https://github.com/hantdev.png","language":"Go","readme":"# Chorus Controller\n\nA control plane for Chorus Worker that manages S3 replication jobs.\n\n## Project Structure\n\n```\nchorus-controller/\n├── cmd/                    # Application entry points\n│   └── main.go           # Main application entry point\n├── internal/              # Private application code\n│   ├── config/           # Configuration management\n│   │   └── config.go     # Configuration structs and loading\n│   ├── domain/           # Domain models and interfaces\n│   │   ├── models.go     # Domain models and DTOs\n│   │   └── interfaces.go # Service interfaces and contracts\n│   ├── service/          # Business logic layer\n│   │   ├── replication.go # Replication business logic\n│   │   └── storage.go    # Storage business logic\n│   ├── repository/       # Data access layer\n│   │   └── worker.go     # Worker gRPC client implementation\n│   ├── handler/          # HTTP handlers\n│   │   ├── health.go     # Health check endpoints\n│   │   ├── replication.go # Replication management endpoints\n│   │   ├── storage.go    # Storage management endpoints\n│   │   └── middleware.go # HTTP middleware and error handling\n│   ├── server/           # HTTP server configuration\n│   │   └── server.go     # Server setup and routing\n│   └── errors/           # Error handling\n│       └── errors.go     # Error types and utilities\n├── docs/                 # API documentation\n│   ├── docs.go          # Swagger documentation setup\n│   ├── swagger.json     # OpenAPI specification\n│   └── swagger.yaml     # OpenAPI specification (YAML)\n├── build/                # Build artifacts\n├── go.mod               # Go module dependencies\n├── go.sum               # Go module checksums\n├── Makefile             # Build and development commands\n└── README.md            \n```\n\n## Key Components\n\n- **`cmd/main.go`**: Application entry point that initializes all layers using dependency injection\n- **`internal/config/`**: Configuration management for worker gRPC address and HTTP port\n- **`internal/domain/`**: Domain models, DTOs, and service interfaces defining business contracts\n- **`internal/service/`**: Business logic layer implementing domain services for replication and storage operations\n- **`internal/repository/`**: Data access layer handling gRPC communication with Chorus Worker service\n- **`internal/handler/`**: HTTP handlers organized by feature (health, storage, replication) with middleware\n- **`internal/server/`**: HTTP server configuration and routing setup\n- **`internal/errors/`**: Centralized error handling with custom error types and HTTP status mapping\n- **`docs/`**: Auto-generated Swagger/OpenAPI documentation\n\n## Architecture\n\nThe project follows **Clean Architecture** principles with clear separation of concerns:\n\n### **Layers**\n1. **Domain Layer** (`internal/domain/`): Contains business models and interfaces\n2. **Service Layer** (`internal/service/`): Implements business logic\n3. **Repository Layer** (`internal/repository/`): Handles data access\n4. **Handler Layer** (`internal/handler/`): Manages HTTP requests/responses\n5. **Server Layer** (`internal/server/`): Configures and runs the HTTP server\n\n### **Benefits**\n- **Testability**: Each layer can be tested independently\n- **Maintainability**: Clear separation makes code easier to understand and modify\n- **Scalability**: New features can be added without affecting existing code\n- **Reusability**: Services can be reused across different handlers\n- **Error Consistency**: Centralized error handling ensures consistent API responses\n\n## API Endpoints\n\n- `GET /health` - Health check\n- `GET /storages` - List all configured storages\n- `GET /buckets` - List buckets available for replication\n- `POST /replications` - Create new replication job\n- `GET /replications` - List all replication jobs\n- `POST /replications/pause` - Pause replication job\n- `POST /replications/resume` - Resume replication job\n- `DELETE /replications` - Delete replication job\n- `POST /replications/switch/zero-downtime` - Switch buckets without downtime\n\n## Development\n\n### Prerequisites\n- Go 1.25+\n- Access to Chorus Worker gRPC service\n\n### Building\n```bash\nmake build\n# or\ngo build ./cmd/main.go\n```\n\n### Running\n```bash\nmake run\n# or\ngo run ./cmd/main.go\n```\n\n### API Documentation\nSwagger UI available at `/swagger/*` when running the server.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhantdev%2Fchorus-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhantdev%2Fchorus-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhantdev%2Fchorus-controller/lists"}