To provide a more robust, typed, and efficient API for external tools and integrations, we should implement a gRPC API.
Using Connect-Go (https://connectrpc.com/) is recommended as it allows:
- Native gRPC support.
- gRPC-Web support (useful for browser-based UIs).
- First-class JSON support over HTTP/1.1 or HTTP/2 (replaces the need for manual
http.ServeMux handling for some routes).
This would involve:
- Defining a
.proto file that mirrors the DownloadService interface.
- Generating Go code for the service.
- Implementing the service handlers.
- Integrating the Connect handler into the existing HTTP server.
To provide a more robust, typed, and efficient API for external tools and integrations, we should implement a gRPC API.
Using Connect-Go (https://connectrpc.com/) is recommended as it allows:
http.ServeMuxhandling for some routes).This would involve:
.protofile that mirrors theDownloadServiceinterface.