2021-09-27 12:42:46 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Wabbajack.DTOs;
|
|
|
|
using Wabbajack.Networking.Http.Interfaces;
|
|
|
|
using Wabbajack.RateLimiter;
|
|
|
|
using Wabbajack.Server.Lib.DTOs;
|
|
|
|
using Wabbajack.Server.Lib.TokenProviders;
|
|
|
|
|
2021-10-23 16:51:17 +00:00
|
|
|
namespace Wabbajack.Server.Lib;
|
|
|
|
|
|
|
|
public static class ServiceExtensions
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2021-10-23 16:51:17 +00:00
|
|
|
public static IServiceCollection AddServerLib(this IServiceCollection services)
|
2021-09-27 12:42:46 +00:00
|
|
|
{
|
2021-10-23 16:51:17 +00:00
|
|
|
return services
|
|
|
|
.AddAllSingleton<ITokenProvider<Dictionary<StorageSpace, FtpSite>>, IFtpSiteCredentials,
|
|
|
|
FtpSiteCredentialsProvider>()
|
|
|
|
.AddSingleton<IResource<IFtpSiteCredentials>>(s => new Resource<IFtpSiteCredentials>("FTP Uploads", 8));
|
2021-09-27 12:42:46 +00:00
|
|
|
}
|
|
|
|
}
|