service library

Service / method descriptors for gRPC + Connect RPC codegen.

Pure, Ball-portable value types (no package: imports — dart:core only): a ServiceDescriptor is a list of MethodDescriptors, each naming its input/output message types, its streaming MethodKind, and its idempotency level. This generalizes the dynamic extractServiceMethods() map shape in grpc_frame.dart into typed values that generated service stubs consume, following the connect-es precedent: message codegen produces schemas, service codegen produces a transport-agnostic service descriptor.

Classes

MethodDescriptor
A single RPC method: its name, its fully-qualified name (package.Service.Method), the message type names of its input and output, its streaming kind, and its idempotency level.
ServiceDescriptor
A service: its fully-qualified name (package.Service) and its ordered list of methods. A transport (gRPC / Connect) consumes this to build a client or dispatch on the server.

Enums

IdempotencyLevel
A method's side-effect contract, mirroring protobuf's MethodOptions.IdempotencyLevel. Connect uses noSideEffects to allow GET for unary calls; gRPC carries it as method metadata.
MethodKind
How an RPC method streams, matching protobuf's client_streaming/server_streaming flag combination on a MethodProto.

Functions

methodKindFromFlags({required bool clientStreaming, required bool serverStreaming}) MethodKind
Maps a (clientStreaming, serverStreaming) flag pair to a MethodKind.