diff --git a/src/EventStore.Plugins/Subsystems/ISubsystem.cs b/src/EventStore.Plugins/Subsystems/ISubsystem.cs new file mode 100644 index 0000000..d591283 --- /dev/null +++ b/src/EventStore.Plugins/Subsystems/ISubsystem.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; + +namespace EventStore.Plugins.Subsystems; + +public interface ISubsystem { + IApplicationBuilder Configure(IApplicationBuilder builder); + IServiceCollection ConfigureServices(IServiceCollection services); + IEnumerable Start(); + void Stop(); +} diff --git a/src/EventStore.Plugins/Subsystems/ISubsystemFactory.cs b/src/EventStore.Plugins/Subsystems/ISubsystemFactory.cs new file mode 100644 index 0000000..fcd39ec --- /dev/null +++ b/src/EventStore.Plugins/Subsystems/ISubsystemFactory.cs @@ -0,0 +1,5 @@ +namespace EventStore.Plugins.Subsystems; + +public interface ISubsystemFactory { + ISubsystem Create(TArg arg); +} diff --git a/src/EventStore.Plugins/Subsystems/ISubsystemsPlugin.cs b/src/EventStore.Plugins/Subsystems/ISubsystemsPlugin.cs new file mode 100644 index 0000000..62f6a0c --- /dev/null +++ b/src/EventStore.Plugins/Subsystems/ISubsystemsPlugin.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace EventStore.Plugins.Subsystems; + +// A plugin that can create multiple subsystems. +// A TArg is required to produce each subsystem from its respective factory. +public interface ISubsystemsPlugin { + string Name { get; } + string Version { get; } + string CommandLineName { get; } + IEnumerable> GetSubsystemFactories(string configPath); +}