Interface IBowireProtocolServices
- Namespace
- Kuestenlogik.Bowire
- Assembly
- Kuestenlogik.Bowire.dll
Optional extension of IBowireProtocol that allows a protocol plugin to register required services and map discovery endpoints automatically.
When a user calls builder.Services.AddBowire(), Bowire scans loaded
assemblies for IBowireProtocol implementations that also
implement this interface and calls ConfigureServices(IServiceCollection) on each one.
Similarly, app.MapBowire() calls MapDiscoveryEndpoints(IEndpointRouteBuilder).
This eliminates the need for protocol-specific boilerplate. For example, the
gRPC plugin uses this to call AddGrpcReflection() and
MapGrpcReflectionService() automatically — but only when the gRPC
protocol package is actually referenced.
public interface IBowireProtocolServices
Methods
ConfigureServices(IServiceCollection)
Register any services this protocol requires for discovery to work.
Called during builder.Services.AddBowire().
Implementations should be idempotent — if the user has already called
the underlying registration (e.g. AddGrpcReflection()), calling
it again must be harmless.
void ConfigureServices(IServiceCollection services)
Parameters
servicesIServiceCollection
MapDiscoveryEndpoints(IEndpointRouteBuilder)
Map any endpoints this protocol needs for auto-discovery.
Called during app.MapBowire().
For example, the gRPC plugin maps MapGrpcReflectionService() here.
Return without mapping anything if the protocol doesn't need its own endpoints.
void MapDiscoveryEndpoints(IEndpointRouteBuilder endpoints)
Parameters
endpointsIEndpointRouteBuilder