change the communication protocol to RMQ

This commit is contained in:
Volodymyr Smirnov
2020-10-26 16:20:47 +02:00
parent b6c3cb4131
commit 29156b7f10
25 changed files with 439 additions and 173 deletions

View File

@@ -17,6 +17,8 @@ namespace MalwareMultiScan.Backends.Backends.Implementations
protected override Regex MatchRegex { get; } =
new Regex(@"(\S+): (?<threat>[\S]+) FOUND", RegexOptions.Compiled | RegexOptions.Multiline);
protected override bool ThrowOnNonZeroExitCode { get; } = false;
protected override string GetBackendArguments(string path)
{
return $"--no-summary {path}";

View File

@@ -0,0 +1,39 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MalwareMultiScan.Shared.Interfaces;
using Microsoft.AspNetCore.Http;
namespace MalwareMultiScan.Backends.Backends.Implementations
{
public class DummyScanBackend : IScanBackend
{
public string Id { get; } = "dummy";
public Task<string[]> ScanAsync(string path, CancellationToken cancellationToken)
{
return Scan();
}
public Task<string[]> ScanAsync(Uri uri, CancellationToken cancellationToken)
{
return Scan();
}
public Task<string[]> ScanAsync(IFormFile file, CancellationToken cancellationToken)
{
return Scan();
}
public Task<string[]> ScanAsync(Stream stream, CancellationToken cancellationToken)
{
return Scan();
}
private static Task<string[]> Scan()
{
return Task.FromResult(new[] {"Malware.Dummy.Result"});
}
}
}