34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using StellaOps.Plugin;
|
|
using StellaOps.Plugin.Versioning;
|
|
|
|
// Declare plugin version for compatibility checking
|
|
[assembly: StellaPluginVersion("1.0.0-template", MinimumHostVersion = "1.0.0")]
|
|
|
|
namespace StellaOps.Plugin.MyConnector;
|
|
|
|
/// <summary>
|
|
/// Plugin entry point for the MyConnector connector.
|
|
/// </summary>
|
|
public sealed class MyConnectorPlugin : IConnectorPlugin
|
|
{
|
|
/// <inheritdoc />
|
|
public string Name => "MyConnector";
|
|
|
|
/// <inheritdoc />
|
|
public bool IsAvailable(IServiceProvider services)
|
|
{
|
|
// Add availability checks here (e.g., required configuration present)
|
|
return true;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public IFeedConnector Create(IServiceProvider services)
|
|
{
|
|
var logger = services.GetRequiredService<ILogger<MyConnector>>();
|
|
var options = services.GetRequiredService<Microsoft.Extensions.Options.IOptions<MyConnectorOptions>>();
|
|
return new MyConnector(logger, options.Value);
|
|
}
|
|
}
|