Files
btcpayserver/BTCPayServer/Storage/Services/Providers/GoogleCloudStorage/GoogleCloudStorageFileProviderService.cs
2019-04-22 16:57:22 +09:00

26 lines
935 B
C#

using System.Threading.Tasks;
using BTCPayServer.Storage.Models;
using BTCPayServer.Storage.Services.Providers.GoogleCloudStorage.Configuration;
using Google.Apis.Auth.OAuth2;
using TwentyTwenty.Storage;
using TwentyTwenty.Storage.Google;
namespace BTCPayServer.Storage.Services.Providers.GoogleCloudStorage
{
public class
GoogleCloudStorageFileProviderService : BaseTwentyTwentyStorageFileProviderServiceBase<
GoogleCloudStorageConfiguration>
{
public override StorageProvider StorageProvider()
{
return Storage.Models.StorageProvider.GoogleCloudStorage;
}
protected override Task<IStorageProvider> GetStorageProvider(
GoogleCloudStorageConfiguration configuration)
{
return Task.FromResult<IStorageProvider>(new GoogleStorageProvider(GoogleCredential.FromJson(configuration.JsonCredentials), configuration));
}
}
}