Files
git.stella-ops.org/src/StellaOps.Feedser.Exporter.TrivyDb/TrivyDbExporterPlugin.cs
master 304118b665
Some checks failed
Build Test Deploy / build-test (push) Has been cancelled
Build Test Deploy / docs (push) Has been cancelled
Build Test Deploy / deploy (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
commit and up
2025-10-07 08:33:54 +03:00

24 lines
701 B
C#

using System;
using Microsoft.Extensions.DependencyInjection;
using StellaOps.Feedser.Storage.Mongo.Advisories;
using StellaOps.Plugin;
namespace StellaOps.Feedser.Exporter.TrivyDb;
public sealed class TrivyDbExporterPlugin : IExporterPlugin
{
public string Name => TrivyDbFeedExporter.ExporterName;
public bool IsAvailable(IServiceProvider services)
{
ArgumentNullException.ThrowIfNull(services);
return services.GetService<IAdvisoryStore>() is not null;
}
public IFeedExporter Create(IServiceProvider services)
{
ArgumentNullException.ThrowIfNull(services);
return ActivatorUtilities.CreateInstance<TrivyDbFeedExporter>(services);
}
}