Interface IBowirePluginSettings
- Namespace
- Kuestenlogik.Bowire.Plugins
- Assembly
- Kuestenlogik.Bowire.dll
What a plugin's declared settings are actually set to (#640).
public interface IBowirePluginSettings
Remarks
Settings lets a plugin contribute a schema to
Settings → Plugins. Until this existed, that was all it did: the
workbench rendered the controls and wrote them to the browser's local
storage, and no value ever reached the plugin that declared it. Four
plugins shipped a control that looked like it worked and did not.
Pull, not push. A plugin resolves this from the provider it is handed
in Initialize(IServiceProvider?) and asks when it needs a value.
The alternative — adding a settings argument to DiscoverAsync — would
change the contract every protocol plugin implements, in every repository,
to deliver something most calls do not want. Asking also means a long-lived
plugin sees a change without being restarted.
Values are workspace-scoped. A probe window is a property of what you
are pointed at — a slow lab network — rather than of who you are. Which
workspace is being served comes from
BowirePluginSettingsScope, because DiscoverAsync has no
HttpContext to read it from.
Methods
GetBool(string, string, bool)
The value as a flag, or fallback.
bool GetBool(string pluginId, string key, bool fallback)
Parameters
Returns
GetInt(string, string, int)
The value as a whole number, or fallback.
int GetInt(string pluginId, string key, int fallback)
Parameters
Returns
GetSeconds(string, string, TimeSpan)
The value read as a number of seconds, or fallback.
TimeSpan GetSeconds(string pluginId, string key, TimeSpan fallback)
Parameters
Returns
Remarks
Seconds because that is what the schema's "number" settings mean
wherever a duration is declared, and because a plugin that has to
remember which unit its own setting is in will eventually get it wrong.
Zero and negative values fall back: a probe window of nothing is not a
configuration, it is a mistake, and honouring it would look exactly
like the bug this seam exists to fix.
GetValue(string, string)
The raw value for key, or null when nobody
set one.
string? GetValue(string pluginId, string key)