mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-05-03 01:22:49 +08:00

* copied everything from repos back to ocelot repo * added src projects to sln * removed all test projects that have no tests * added all test projects to sln * removed test not on master * merged unit tests * merged acceptance tests * merged integration tests * fixed namepaces * build script creates packages for all projects * updated docs to make sure no references to external repos that we will remove * +semver: breaking
29 lines
1.2 KiB
C#
29 lines
1.2 KiB
C#
namespace Ocelot.Provider.Rafty
|
|
{
|
|
using Configuration.Setter;
|
|
using DependencyInjection;
|
|
using global::Rafty.Concensus.Node;
|
|
using global::Rafty.FiniteStateMachine;
|
|
using global::Rafty.Infrastructure;
|
|
using global::Rafty.Log;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
|
|
public static class OcelotAdministrationBuilderExtensions
|
|
{
|
|
public static IOcelotAdministrationBuilder AddRafty(this IOcelotAdministrationBuilder builder)
|
|
{
|
|
var settings = new InMemorySettings(4000, 6000, 100, 10000);
|
|
builder.Services.RemoveAll<IFileConfigurationSetter>();
|
|
builder.Services.AddSingleton<IFileConfigurationSetter, RaftyFileConfigurationSetter>();
|
|
builder.Services.AddSingleton<ILog, SqlLiteLog>();
|
|
builder.Services.AddSingleton<IFiniteStateMachine, OcelotFiniteStateMachine>();
|
|
builder.Services.AddSingleton<ISettings>(settings);
|
|
builder.Services.AddSingleton<IPeersProvider, FilePeersProvider>();
|
|
builder.Services.AddSingleton<INode, Node>();
|
|
builder.Services.Configure<FilePeers>(builder.ConfigurationRoot);
|
|
return builder;
|
|
}
|
|
}
|
|
}
|