Improve ipc (#102)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-09-01 20:10:03 +02:00
1 parent 47f5756e5a
commit fc64c0b505
81 files changed
+2408 -799

No files matched your search

@@ -1,3 +1,5 @@
using RustService = AIStudio.Tools.RustService;
namespace AIStudio.Provider;
/// <summary>
@@ -9,13 +11,31 @@ public abstract class BaseProvider
/// The HTTP client to use for all requests.
/// </summary>
protected readonly HttpClient httpClient = new();
/// <summary>
/// The logger to use.
/// </summary>
protected readonly ILogger logger;
static BaseProvider()
{
RUST_SERVICE = Program.RUST_SERVICE;
ENCRYPTION = Program.ENCRYPTION;
}
protected static readonly RustService RUST_SERVICE;
protected static readonly Encryption ENCRYPTION;
/// <summary>
/// Constructor for the base provider.
/// </summary>
/// <param name="url">The base URL for the provider.</param>
protected BaseProvider(string url)
/// <param name="loggerService">The logger service to use.</param>
protected BaseProvider(string url, ILogger loggerService)
{
this.logger = loggerService;
// Set the base URL:
this.httpClient.BaseAddress = new(url);
}