robinrodricks / FluentStorage

A polycloud .NET cloud storage abstraction layer. Provides Blob storage (AWS S3, GCP, FTP, SFTP, Azure Blob/File/Event Hub/Data Lake) and Messaging (AWS SQS, Azure Queue/ServiceBus). Supports .NET 5+ and .NET Standard 2.0+. Pure C#.
MIT License
263 stars 33 forks source link

The MinIO extension method in FluentStorage.Factory is missing the "IBlobStorageFactory this" parameter #65

Closed AloisMaierhofer closed 3 months ago

AloisMaierhofer commented 3 months ago

The MinIO (meant to be) extension method in FluentStorage.Factory is missing the IBlobStorageFactory this parameter.

As a workaround one can call FluentStorage.Factory.MinIO directly.

If more assemblies that implement the FluentStorage.Factory extension methods class (for example AWS and Azure), additional steps are required to be able to select the AWS - related version of this class:

  1. add an alias to the referenced FluentStorage.AWS assembly, let's say "FluentStorageAWS" (see MS documentation)
  2. add the statement extern alias FluentStorageAWS; at the very beginning of the file you need it (before usings)
  3. call it via prepending the alias to the namespace: FluentStorageAWS.FluentStorage.Factory.MinIO(...)
robinrodricks commented 3 months ago

Is there a fix I can do at the library level instead of all these workarounds?

AloisMaierhofer commented 3 months ago

I guess it should be very easy:

in class FluentStorage.Factory in the FluentStorage.AWS project

just add the IBlobStorageFactory this parameter:

public static IBlobStorage MinIO(
  this IBlobStorageFactory factory,             // missing parameter in v5.3.0
  string accessKeyId,
  string secretAccessKey,
  string bucketName,
  string awsRegion,
  string minioServerUrl,
  string sessionToken = null)
{
  return (IBlobStorage) AwsS3BlobStorage.FromMinIO(accessKeyId, secretAccessKey, bucketName, awsRegion, minioServerUrl, sessionToken);
}

this should do the trick, actually.

robinrodricks commented 3 months ago

Done.

https://www.nuget.org/packages/FluentStorage.AWS/5.3.1

AloisMaierhofer commented 3 months ago

Your prompt response is highly appreciated.