Priority: High
Category: API & Interface
Estimated Effort: Medium
Description
Currently, GoVaultFS only provides a programmatic Go API. Adding a REST API server would enable:
- Web-based file upload/download
- Integration with other applications
- Remote management capabilities
- HTTP-based file sharing
Implementation Plan
-
Create HTTP Server Module (api/server.go)
- Implement REST endpoints:
POST /files - Upload file
GET /files/{hash} - Download file by hash
DELETE /files/{hash} - Delete file
GET /files - List stored files
GET /peers - List connected peers
GET /health - Health check endpoint
-
Add Middleware Support
- CORS handling for web clients
- Request logging and metrics
- Authentication/authorization (optional)
- Rate limiting for uploads
-
Integration Points
- Wrap existing FileServer methods
- Handle multipart file uploads
- Stream file downloads efficiently
- Return JSON responses with metadata
-
Configuration
- Add HTTP port configuration
- Enable/disable API server
- Configure max upload size
Files to Create/Modify:
api/server.go - HTTP server implementation
api/handlers.go - Request handlers
api/middleware.go - HTTP middleware
main.go - Add HTTP server initialization
server.go - Add API integration points
Priority: High
Category: API & Interface
Estimated Effort: Medium
Description
Currently, GoVaultFS only provides a programmatic Go API. Adding a REST API server would enable:
Implementation Plan
Create HTTP Server Module (
api/server.go)POST /files- Upload fileGET /files/{hash}- Download file by hashDELETE /files/{hash}- Delete fileGET /files- List stored filesGET /peers- List connected peersGET /health- Health check endpointAdd Middleware Support
Integration Points
Configuration
Files to Create/Modify:
api/server.go- HTTP server implementationapi/handlers.go- Request handlersapi/middleware.go- HTTP middlewaremain.go- Add HTTP server initializationserver.go- Add API integration points