diff options
Diffstat (limited to 'Impostor-dev/src/Impostor.Api/Plugins')
4 files changed, 72 insertions, 0 deletions
diff --git a/Impostor-dev/src/Impostor.Api/Plugins/IPlugin.cs b/Impostor-dev/src/Impostor.Api/Plugins/IPlugin.cs new file mode 100644 index 0000000..fd0f38f --- /dev/null +++ b/Impostor-dev/src/Impostor.Api/Plugins/IPlugin.cs @@ -0,0 +1,14 @@ +using System.Threading.Tasks; +using Impostor.Api.Events; + +namespace Impostor.Api.Plugins +{ + public interface IPlugin : IEventListener + { + ValueTask EnableAsync(); + + ValueTask DisableAsync(); + + ValueTask ReloadAsync(); + } +}
\ No newline at end of file diff --git a/Impostor-dev/src/Impostor.Api/Plugins/IPluginStartup.cs b/Impostor-dev/src/Impostor.Api/Plugins/IPluginStartup.cs new file mode 100644 index 0000000..aa6a35f --- /dev/null +++ b/Impostor-dev/src/Impostor.Api/Plugins/IPluginStartup.cs @@ -0,0 +1,12 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace Impostor.Api.Plugins +{ + public interface IPluginStartup + { + void ConfigureHost(IHostBuilder host); + + void ConfigureServices(IServiceCollection services); + } +}
\ No newline at end of file diff --git a/Impostor-dev/src/Impostor.Api/Plugins/ImpostorPluginAttribute.cs b/Impostor-dev/src/Impostor.Api/Plugins/ImpostorPluginAttribute.cs new file mode 100644 index 0000000..b31bd47 --- /dev/null +++ b/Impostor-dev/src/Impostor.Api/Plugins/ImpostorPluginAttribute.cs @@ -0,0 +1,24 @@ +using System; + +namespace Impostor.Api.Plugins +{ + [AttributeUsage(AttributeTargets.Class)] + public class ImpostorPluginAttribute : Attribute + { + public ImpostorPluginAttribute(string package, string name, string author, string version) + { + Package = package; + Name = name; + Author = author; + Version = version; + } + + public string Package { get; } + + public string Name { get; } + + public string Author { get; } + + public string Version { get; } + } +}
\ No newline at end of file diff --git a/Impostor-dev/src/Impostor.Api/Plugins/PluginBase.cs b/Impostor-dev/src/Impostor.Api/Plugins/PluginBase.cs new file mode 100644 index 0000000..0384363 --- /dev/null +++ b/Impostor-dev/src/Impostor.Api/Plugins/PluginBase.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; + +namespace Impostor.Api.Plugins +{ + public class PluginBase : IPlugin + { + public virtual ValueTask EnableAsync() + { + return default; + } + + public virtual ValueTask DisableAsync() + { + return default; + } + + public virtual ValueTask ReloadAsync() + { + return default; + } + } +}
\ No newline at end of file |