Namespace Kuestenlogik.Bowire.Protocol.Grpc.Mock
Classes
- DescriptorPool
Builds a live Google.Protobuf.Reflection.FileDescriptor pool from the base64-encoded
schemaDescriptorpayloads attached to gRPC recording steps. The pool is consumed by the mock's gRPC Server Reflection endpoint so a second Bowire workbench can auto-discover the mocked services without needing out-of-band access to the original.protofiles.
- GrpcMockHostingExtension
gRPC plugin's hosting extension. Three responsibilities the mock server delegates here when the loaded recording contains gRPC steps:
- Force HTTP/2 hosting (gRPC requires it; plaintext HTTP/1.1 and HTTP/2 can't share a port without TLS+ALPN).
- Build a per-recording
ReflectionServiceImplfrom the captured FileDescriptorSets and register it in DI. - Map the gRPC reflection endpoint so a peer Bowire
workbench can auto-discover the mocked services without
the user supplying
.protofiles out of band.
- ProtobufMockSchemaSource
gRPC plugin's contribution to the Bowire mock server's schema-only flow. When the user runs
bowire mock --grpc-schema <path>, the mock server discovers this IBowireMockSchemaSource (Kind ="protobuf") and delegates the FileDescriptorSet → recording conversion to ProtobufRecordingBuilder.
- ProtobufRecordingBuilder
Turns a protobuf Google.Protobuf.Reflection.FileDescriptorSet binary (the output of
protoc --descriptor_set_out=...) into a synthetic BowireRecording: every gRPC method in every service becomes a step with ResponseBinary populated from ProtobufSampleEncoder. The existing mock pipeline —UnaryReplayer.ReplayGrpcAsync+DescriptorPool+Grpc.Reflection.ReflectionServiceImpl— handles the rest with no new wiring.
- ProtobufSampleEncoder
Hand-rolled protobuf wire-format encoder that emits a plausible sample instance of a message given only its Google.Protobuf.Reflection.MessageDescriptor. Complements
Kuestenlogik.Bowire.Protocol.Rest.Mock.OpenApiSampleGeneratorfor the gRPC schema-only mock path: instead of JSON text, we produce the raw binary bytes the gRPC framer wraps in a length-prefixed envelope.