Fast.Consul public API
Targets: net8.0;net9.0;net10.0. This is a declaration and XML-comment reference. See the module guide for usage and constraints.
Source commit: 43554c07f6c216f80b509bd535c0a5b66ae7f2e8. Maintained through scripts/export-dotnet-api.ps1 -Language en; ordinary site builds consume this file directly.
Fast.Consul.ConsulServiceCollectionExtensions
Source · Targets: net8.0, net9.0, net10.0
public static class ConsulServiceCollectionExtensionsConsul service registration extensions
Fast.Consul.ConsulServiceCollectionExtensions.AddFastConsul
Source · Targets: net8.0, net9.0, net10.0
public static IServiceCollection AddFastConsul(this IServiceCollection services, IConfiguration configuration,
string section = "ConsulSettings")Registers Consul service discovery, health checks and key-value services
- Parameter
services: Service collection - Parameter
configuration: Application configuration - Parameter
section: Configuration section name - Returns: Returns the current service collection for chaining
Fast.Consul.IKeyValueService
Source · Targets: net8.0, net9.0, net10.0
public interface IKeyValueServiceKey/value service
Fast.Consul.IKeyValueService.GetKeyValue
Source · Targets: net8.0, net9.0, net10.0
Task<T> GetKeyValue<T>(string settingPath, string dcName);Reads Consul configuration
- Throws
ArgumentException:settingPathordcNameis empty - Throws
KeyNotFoundException: The specified configuration path does not exist in Consul - Throws
FormatException: The configuration value returned by Consul is not valid Base64 text - Throws
System.Text.Json.JsonException: The configuration content cannot be deserialized asT - Parameter
settingPath: Key path containing the configuration in Consul - Parameter
dcName: Consul datacenter name - Type parameter
T: Type to deserialize the configuration value into - Returns: A task whose result is the retrieved Consul configuration
Fast.Consul.IKeyValueService.GetKeyValue
Source · Targets: net8.0, net9.0, net10.0
Task<string> GetKeyValue(string settingPath, string dcName);Reads Consul configuration
- Throws
ArgumentException:settingPathordcNameis empty - Throws
KeyNotFoundException: The specified configuration path does not exist in Consul - Throws
FormatException: The configuration value returned by Consul is not valid Base64 text - Parameter
settingPath: Key path containing the configuration in Consul - Parameter
dcName: Consul datacenter name - Returns: A task whose result is the retrieved Consul configuration
Fast.Consul.IKeyValueService.EditKeyValue
Source · Targets: net8.0, net9.0, net10.0
Task<bool> EditKeyValue(string settingPath, string dcName, string data);Edits Consul configuration
- Throws
ArgumentException:settingPathordcNameis empty - Parameter
settingPath: Key path containing the configuration in Consul - Parameter
dcName: Consul datacenter name - Parameter
data: Configuration text to write to Consul - Returns: Returns
truewhen Consul confirms the write; otherwisefalse
Fast.Consul.KeyValueService
Source · Targets: net8.0, net9.0, net10.0
public class KeyValueService : IKeyValueServiceDocumentation is inherited from an interface or base class; consult that declaration.
Fast.Consul.KeyValueService.GetKeyValue
Source · Targets: net8.0, net9.0, net10.0
public async Task<T> GetKeyValue<T>(string settingPath, string dcName)Documentation is inherited from an interface or base class; consult that declaration.
Fast.Consul.KeyValueService.GetKeyValue
Source · Targets: net8.0, net9.0, net10.0
public async Task<string> GetKeyValue(string settingPath, string dcName)Documentation is inherited from an interface or base class; consult that declaration.
Fast.Consul.KeyValueService.EditKeyValue
Source · Targets: net8.0, net9.0, net10.0
public async Task<bool> EditKeyValue(string settingPath, string dcName, string data)Documentation is inherited from an interface or base class; consult that declaration.
Fast.Consul.ConsulSettingsOptions
Source · Targets: net8.0, net9.0, net10.0
public sealed class ConsulSettingsOptions : IPostConfigureConsul configuration options
Fast.Consul.ConsulSettingsOptions.Enable
Source · Targets: net8.0, net9.0, net10.0
[Required]
public bool? Enable { get; set; }Whether Consul is enabled
Fast.Consul.ConsulSettingsOptions.Address
Source · Targets: net8.0, net9.0, net10.0
[Required]
public string Address { get; set; }Consul client address
Fast.Consul.ConsulSettingsOptions.ServiceAddress
Source · Targets: net8.0, net9.0, net10.0
public string ServiceAddress { get; set; }Advertised service address; uses the actual server listening address when empty
Remarks: In containers or behind reverse proxies, explicitly configure an absolute address reachable by Consul.
Fast.Consul.ConsulSettingsOptions.HealthCheck
Source · Targets: net8.0, net9.0, net10.0
[Required]
public string HealthCheck { get; set; }Consul health check address
Fast.Consul.ConsulSettingsOptions.DeregisterCriticalServiceAfter
Source · Targets: net8.0, net9.0, net10.0
public int? DeregisterCriticalServiceAfter { get; set; }Delay after Consul service startup before registration, in seconds
Fast.Consul.ConsulSettingsOptions.HealthCheckInterval
Source · Targets: net8.0, net9.0, net10.0
public int? HealthCheckInterval { get; set; }Consul health check interval in seconds
Fast.Consul.ConsulSettingsOptions.HealthCheckTimeout
Source · Targets: net8.0, net9.0, net10.0
public int? HealthCheckTimeout { get; set; }Consul health check timeout in seconds
Fast.Consul.ConsulSettingsOptions.PostConfigure
Source · Targets: net8.0, net9.0, net10.0
public void PostConfigure()Documentation is inherited from an interface or base class; consult that declaration.
