Skip to content

Plugins

Dominic Hock edited this page Apr 12, 2022 · 4 revisions

General Information about plugins

IReportCollector

The IReportCollector interface provides a single function public IEnumerable<Report> GatherReports() which should return all reports gathered by the plugin.

Example

public class SampleCollector : IReportCollector
{
    public IEnumerable<Report> GatherReports()
    {
        var reports = new List<Report>();
        reports.Add(new Report(){
                SourceIpAddress = "127.0.0.1",
        });
        return reports;
    }
}

IReportProcessor

The IReportProcessor interface provides a single function public bool ProcessReport(Report report) to process a single report.

Example

public class SampleProcessor : IReportProcessor
{
    public bool ProcessReport(Report report)
    {
        File.WriteAllText($"report_{report.SourceIpAddress}.txt", report.ToString());
        return true;
    }
}
Clone this wiki locally