Class ConfigurationExtensions
Configure ASP.NET Core application to reuse application's web host and port for Raft endpoint.
Inherited Members
Namespace: DotNext.Net.Cluster.Consensus.Raft.Http.Embedding
Assembly: DotNext.AspNetCore.Cluster.dll
Syntax
[CLSCompliant(false)]
public static class ConfigurationExtensions
Methods
| Improve this Doc View SourceConfigureLocalNode(IServiceCollection, IConfiguration)
Allows to inject
Declaration
public static IServiceCollection ConfigureLocalNode(this IServiceCollection services, IConfiguration memberConfig)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of services. |
| IConfiguration | memberConfig | The configuration of local cluster node. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The modified collection of services. |
Remarks
This method should not be used together with JoinCluster(IHostBuilder) because it has the same semantics. It's here just for corner case when you want to implement choice between hosted and embedded mode in the same app or library.
JoinCluster(IHostBuilder)
Allows to inject
Declaration
public static IHostBuilder JoinCluster(this IHostBuilder builder)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostBuilder | builder | The host builder. |
Returns
| Type | Description |
|---|---|
| IHostBuilder | The modified host builder. |
Remarks
Should be called exactly after ConfigureWebHost(IHostBuilder, Action<IWebHostBuilder>) or ConfigureWebHostDefaults(IHostBuilder, Action<IWebHostBuilder>).
JoinCluster(IHostBuilder, Func<IConfiguration, IHostEnvironment, IConfiguration>)
Allows to inject
Declaration
public static IHostBuilder JoinCluster(this IHostBuilder builder, Func<IConfiguration, IHostEnvironment, IConfiguration> memberConfig)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostBuilder | builder | The host builder. |
| Func<IConfiguration, IHostEnvironment, IConfiguration> | memberConfig | The delegate that allows to resolve location of local member configuration. |
Returns
| Type | Description |
|---|---|
| IHostBuilder | The modified host builder. |
Remarks
Should be called exactly after ConfigureWebHost(IHostBuilder, Action<IWebHostBuilder>) or ConfigureWebHostDefaults(IHostBuilder, Action<IWebHostBuilder>).
JoinCluster(IHostBuilder, String)
Allows to inject
Declaration
public static IHostBuilder JoinCluster(this IHostBuilder builder, string memberConfigSection)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostBuilder | builder | The host builder. |
| String | memberConfigSection | The name of local member configuration section. |
Returns
| Type | Description |
|---|---|
| IHostBuilder | The modified host builder. |
Remarks
Should be called exactly after ConfigureWebHost(IHostBuilder, Action<IWebHostBuilder>) or ConfigureWebHostDefaults(IHostBuilder, Action<IWebHostBuilder>).
UseConsensusProtocolHandler(IApplicationBuilder)
Setup Raft protocol handler as middleware for the specified application.
Declaration
public static IApplicationBuilder UseConsensusProtocolHandler(this IApplicationBuilder builder)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | builder | The application builder. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The configured application builder. |