2020-10-15 14:28:09 +02:00
|
|
|
using System;
|
2020-10-21 14:02:20 +02:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
using BTCPayServer.Abstractions.Converters;
|
2020-10-15 14:28:09 +02:00
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
2020-11-17 13:46:23 +01:00
|
|
|
namespace BTCPayServer.Abstractions.Contracts
|
2020-10-15 14:28:09 +02:00
|
|
|
{
|
2020-10-21 14:02:20 +02:00
|
|
|
public interface IBTCPayServerPlugin
|
2020-10-15 14:28:09 +02:00
|
|
|
{
|
2020-10-21 14:02:20 +02:00
|
|
|
public string Identifier { get; }
|
2020-10-15 14:28:09 +02:00
|
|
|
string Name { get; }
|
2020-10-21 14:02:20 +02:00
|
|
|
[JsonConverter(typeof(VersionConverter))]
|
2020-10-15 14:28:09 +02:00
|
|
|
Version Version { get; }
|
|
|
|
string Description { get; }
|
2020-10-21 14:02:20 +02:00
|
|
|
bool SystemPlugin { get; set; }
|
2020-11-05 15:43:14 +01:00
|
|
|
PluginDependency[] Dependencies { get; }
|
2020-10-15 14:28:09 +02:00
|
|
|
void Execute(IApplicationBuilder applicationBuilder, IServiceProvider applicationBuilderApplicationServices);
|
|
|
|
void Execute(IServiceCollection applicationBuilder);
|
2020-11-05 15:43:14 +01:00
|
|
|
|
|
|
|
public class PluginDependency
|
|
|
|
{
|
|
|
|
public string Identifier { get; set; }
|
|
|
|
public string Condition { get; set; }
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
return $"{Identifier}: {Condition}";
|
|
|
|
}
|
|
|
|
}
|
2020-10-15 14:28:09 +02:00
|
|
|
}
|
2021-12-31 16:59:02 +09:00
|
|
|
|
2020-10-15 14:28:09 +02:00
|
|
|
}
|