Class BowireGrpcOptions

Namespace
Kuestenlogik.Bowire.Protocol.Grpc
Assembly
Kuestenlogik.Bowire.Protocol.Grpc.dll

How an embedding host tells the gRPC plugin about its contract (#992).

public sealed class BowireGrpcOptions
Inheritance
BowireGrpcOptions
Inherited Members

Remarks

Embedded, Bowire runs inside the process whose gRPC services it is asked to show. Their descriptors are already there: protoc-generated code carries a Google.Protobuf.Reflection.FileDescriptor per .proto. The plugin reads them from the gRPC services the host maps, so a host that only calls AddBowire() and MapBowire() is discovered and called with nothing set here and without a reflection endpoint.

These options cover what that cannot see: a service the host does not map itself, a contract that lives in another process, and a host that wants the reflection endpoint after all.

Constructors

BowireGrpcOptions()

public BowireGrpcOptions()

Properties

Descriptors

Descriptors to discover and call through, in addition to those of the gRPC services the host maps. Add the generated one, e.g. Greeter.Descriptor.File or GreeterReflection.Descriptor; its imports come along.

public IList<FileDescriptor> Descriptors { get; }

Property Value

IList<FileDescriptor>

DescriptorSet

A compiled FileDescriptorSet (protoc --descriptor_set_out --include_imports) to discover and call through, for services that live in another process and have no generated code in this one.

public ReadOnlyMemory<byte> DescriptorSet { get; set; }

Property Value

ReadOnlyMemory<byte>

DescriptorSetFile

The same as DescriptorSet, read from a file when the plugin first needs it. A relative path is resolved against the content root.

public string? DescriptorSetFile { get; set; }

Property Value

string

MapReflectionService

Whether MapBowire() also maps the gRPC Server Reflection endpoints (grpc.reflection.v1 and v1alpha). Off by default.

public bool MapReflectionService { get; set; }

Property Value

bool

Remarks

Bowire does not need them to show the host's own services. Mapping them publishes the whole contract to every client that can reach the port, and a host that classifies or audits its endpoints has two more to account for. Switch this on when other reflection clients (grpcurl, a standalone Bowire) should be able to ask this host.

UseMappedServices

Whether the plugin reads the descriptors of the gRPC services the host maps. On by default; switch it off to show only what Descriptors and the descriptor set name.

public bool UseMappedServices { get; set; }

Property Value

bool