forked from ThreeMammals/Ocelot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ThreeMammals#529 removed raft (ThreeMammals#543)
- Loading branch information
1 parent
4e22b3c
commit cbd0af6
Showing
23 changed files
with
6 additions
and
1,437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 5 additions & 24 deletions
29
src/Ocelot/DependencyInjection/OcelotAdministrationBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,17 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Ocelot.Raft; | ||
using Rafty.Concensus; | ||
using Rafty.FiniteStateMachine; | ||
using Rafty.Infrastructure; | ||
using Rafty.Log; | ||
|
||
namespace Ocelot.DependencyInjection | ||
{ | ||
using Rafty.Concensus.Node; | ||
|
||
public class OcelotAdministrationBuilder : IOcelotAdministrationBuilder | ||
{ | ||
private readonly IServiceCollection _services; | ||
private readonly IConfiguration _configurationRoot; | ||
private IServiceCollection Services { get; } | ||
private IConfiguration ConfigurationRoot { get; } | ||
|
||
public OcelotAdministrationBuilder(IServiceCollection services, IConfiguration configurationRoot) | ||
{ | ||
_configurationRoot = configurationRoot; | ||
_services = services; | ||
} | ||
|
||
public IOcelotAdministrationBuilder AddRafty() | ||
{ | ||
var settings = new InMemorySettings(4000, 6000, 100, 10000); | ||
_services.AddSingleton<ILog, SqlLiteLog>(); | ||
_services.AddSingleton<IFiniteStateMachine, OcelotFiniteStateMachine>(); | ||
_services.AddSingleton<ISettings>(settings); | ||
_services.AddSingleton<IPeersProvider, FilePeersProvider>(); | ||
_services.AddSingleton<INode, Node>(); | ||
_services.Configure<FilePeers>(_configurationRoot); | ||
return this; | ||
ConfigurationRoot = configurationRoot; | ||
Services = services; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.