gRPC / Protobuf API Builder
Defines versioned protobuf contracts, streaming RPCs, error model, and generates client/server stubs with interceptors.
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. ================================================================================
自动翻译
自动翻译中…