Severity: 🟠 HIGH — --api grpc / --api graphql is ignored; project is always a REST/HTTP server
goca init --api grpc (and --api graphql) does not change the generated architecture. The generated cmd/server/main.go always builds a REST HTTP server (mux.NewRouter() + http.Server), and goca feature in such a project always generates an HTTP handler — never gRPC/GraphQL.
Reproduction
goca init api_grpc --module github.com/test/api_grpc --api grpc
grep -c mux api_grpc/cmd/server/main.go # -> uses mux.NewRouter() (REST)
cd api_grpc
goca feature Thing --fields "x:int"
ls internal/handler/ # -> http/thing_handler.go (not grpc)
Actual result
cmd/server/main.go uses router := mux.NewRouter() and &http.Server{...} for --api grpc.
feature produces internal/handler/http/thing_handler.go (HTTP), with no .proto / gRPC server.
- Same for
--api graphql: HTTP handler only.
The standalone goca handler Gadget --type grpc does generate internal/handler/grpc/gadget.proto, so gRPC generation exists but is unreachable from the --api project setting and from feature.
Expected
--api grpc should scaffold a gRPC server in main.go and make feature default its handler to gRPC (likewise GraphQL). At minimum the configured API type must drive feature's handler type. Otherwise the --api flag is misleading.
Severity: 🟠 HIGH —
--api grpc/--api graphqlis ignored; project is always a REST/HTTP servergoca init --api grpc(and--api graphql) does not change the generated architecture. The generatedcmd/server/main.goalways builds a REST HTTP server (mux.NewRouter()+http.Server), andgoca featurein such a project always generates an HTTP handler — never gRPC/GraphQL.Reproduction
Actual result
cmd/server/main.gousesrouter := mux.NewRouter()and&http.Server{...}for--api grpc.featureproducesinternal/handler/http/thing_handler.go(HTTP), with no.proto/ gRPC server.--api graphql: HTTP handler only.The standalone
goca handler Gadget --type grpcdoes generateinternal/handler/grpc/gadget.proto, so gRPC generation exists but is unreachable from the--apiproject setting and fromfeature.Expected
--api grpcshould scaffold a gRPC server inmain.goand makefeaturedefault its handler to gRPC (likewise GraphQL). At minimum the configured API type must drivefeature's handler type. Otherwise the--apiflag is misleading.