gRPC / Protobuf API Builder

作者:promptpacks发布日期:2026-09-21观看:23

Defines versioned protobuf contracts, streaming RPCs, error model, and generates client/server stubs with interceptors.

01/ 01

Design gRPC service "{{NAME}}" (proto3, buf) for {{DOMAIN}}. - Define messages, enums (prefix enum values), oneof for polymorphic results, and field reservation for evolution. Package with api.v1 and HTTP annotations (grpc-gateway) if browser access is needed. - Choose unary/server-stream/client-stream/bidi per RPC and justify each. - Error model: canonical gRPC status codes + rich error details (google.rpc.Status, BadRequest.FieldViolation, RetryInfo); client retry guidance per method (idempotency, backoff metadata). - Auth interceptor (JWT scopes), logging/interceptor order, deadline propagation, max message size, and compression. - Provide buf.yaml/buf.gen.yaml, generated TS + Python stubs usage, a server implementation with in-memory adapter, and tests with grpcurl examples. Show the .proto files and error-code table first for my approval. ================================================================================

自动翻译

自动翻译中…

🔥热搜词

评论0

登录后参与评论

还没有评论,来抢沙发吧