Interface IBowireProtocol
- Namespace
- Kuestenlogik.Bowire
- Assembly
- Kuestenlogik.Bowire.dll
Protocol plugin for Bowire. Implement this to add support for a new protocol. Discovered automatically via assembly scanning.
public interface IBowireProtocol
Properties
Description
One-line description shown next to the plugin's display name
in Settings → Plugins. Optional; defaults to empty so
the row falls back to "DisplayName + version" without the
description line. Keep it short (≤ 100 characters) — the row
truncates anything wider than the manage panel.
string Description { get; }
Property Value
DescriptionKey
#691 — optional catalogue key for Description. When the workbench's active locale has an entry for it, that entry is shown; otherwise Description is, exactly as before. Third-party plugins leave it empty and keep today's behaviour.
string DescriptionKey { get; }
Property Value
IconSvg
SVG icon for the protocol tab.
string IconSvg { get; }
Property Value
Id
Short identifier (e.g., "grpc", "signalr").
string Id { get; }
Property Value
Name
Protocol name shown in UI tabs.
string Name { get; }
Property Value
Settings
Settings schema this plugin contributes to the Settings dialog. Each entry becomes a toggle/input in the plugin's section. Default implementation returns empty (no plugin-specific settings).
IReadOnlyList<BowirePluginSetting> Settings { get; }
Property Value
Methods
DiscoverAsync(string, bool, IReadOnlyDictionary<string, string>?, CancellationToken)
Same, with the per-call metadata InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken) already receives.
Task<List<BowireServiceInfo>> DiscoverAsync(string serverUrl, bool showInternalServices, IReadOnlyDictionary<string, string>? metadata, CancellationToken ct = default)
Parameters
serverUrlstringshowInternalServicesboolmetadataIReadOnlyDictionary<string, string>ctCancellationToken
Returns
Remarks
Discovery was the one operation with no way to carry configuration, and it is the operation that decides whether anything else can run at all. A gRPC server with reflection switched off could be invoked once a descriptor set was supplied, but could not be enumerated — so a scan could not find the methods it was meant to test, and mTLS-protected servers could not be reflected against at all.
A default implementation that drops the metadata, so a plugin with no
per-environment configuration to honour stays exactly as it is. Only a
plugin that already reads a marker out of metadata elsewhere has
any reason to override it.
DiscoverAsync(string, bool, CancellationToken)
Discover available services and methods.
Task<List<BowireServiceInfo>> DiscoverAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)
Parameters
serverUrlstringshowInternalServicesboolctCancellationToken
Returns
Initialize(IServiceProvider?)
Called after registration to inject the app's service provider (embedded mode).
void Initialize(IServiceProvider? serviceProvider)
Parameters
serviceProviderIServiceProvider
InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a unary or client-streaming call.
Task<InvokeResult> InvokeAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a server-streaming or duplex call.
IAsyncEnumerable<string> InvokeStreamAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
OpenChannelAsync(string, string, string, bool, Dictionary<string, string>?, CancellationToken)
Open an interactive channel (for duplex/client-streaming).
Task<IBowireChannel?> OpenChannelAsync(string serverUrl, string service, string method, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringshowInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
ResolveMethodName(string, string)
The form of method that InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken),
InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken) and OpenChannelAsync(string, string, string, bool, Dictionary<string, string>?, CancellationToken)
expect, given what a caller sent (#664).
string ResolveMethodName(string service, string method)
Parameters
Returns
Remarks
The contract on /api/invoke is the method's discovery
name. A caller that sends the fullName instead — the
other field the discovery response carries, and the obvious one to
reach for — is met halfway: the endpoints run the identifier
through this before dispatch, so the plugin only ever sees the
form it reads.
The default reduces the common <service>/<name>
shape to the name and passes anything else through untouched. A
plugin whose FullName encodes a route rather than a
service-qualified name (a topic, a subject) overrides this to
accept both its name and its route.