開發流程
01 scaffold-smoke — 開發者流程全程
Section titled “01 scaffold-smoke — 開發者流程全程”證明 create → gen → build → test 一路可跑,加第二個 API 後仍成立。這是 scaffold 的 transport smoke test;它檢查 create 能替換 placeholder,不是允許把產出的可用 secret 提交或打進 image。
gortexa create myapp --module github.com/me/myappcd myappmake gen # buf lint → breaking → generatego build ./... && go test ./...gortexa gen shop/v1 Product # 加第二個 APImake gen && go build ./... && go test ./...關鍵斷言:proto/shop/v1/product.proto 與 internal/logic/product.go 都產出、cmd/server/main.go 已 wire product,且 etc/config.yaml 一旦含 dev-only-insecure-secret-change-me-please 就判失敗。這只驗證本機可啟動;在 git 或 Docker 前仍必須改成外部 secret injection,並把 in-memory logic 換成真實資料層。
02 multi-protocol-e2e — 同一實體跨三協議
Section titled “02 multi-protocol-e2e — 同一實體跨三協議”在單一 h2c port(:18080)上,gRPC 建的實體用 HTTP 抓得到、MCP 建的也在 list 裡——三協議共享同一份狀態。$TOK 是開發用 token,$SCHEMA 是 buf build 出的 descriptor。
gRPC 建立:
buf curl --protocol grpc --http2-prior-knowledge --schema $SCHEMA \ -H "authorization: Bearer $TOK" \ -d '{"resource":{"name":"grpc-entity","owner":"owner-e2e"}}' \ http://localhost:18080/resource.v1.ResourceService/CreateResourceHTTP gateway 抓同一個 id,再用 MCP tools/call 建第三個:
curl -H "authorization: Bearer $TOK" http://localhost:18080/v1/resources/$RID # 200,同一實體
curl -XPOST http://localhost:18080/mcp -H 'Content-Type: application/json' \ -H "authorization: Bearer $TOK" \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call", "params":{"name":"create_resource", "arguments":{"resource":{"name":"mcp-entity","owner":"owner-e2e"}}}}'最後 list owner-e2e,會同時看到 gRPC、HTTP、MCP 三個來源建立的實體——證明三個表面背後是同一個 store。