Skip to content

Commit

Permalink
Upgraded to latest major minio client
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Jan 4, 2024
1 parent 5afca51 commit e0ed04c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Foundatio.Minio/Foundatio.Minio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageTags>File;Storage;Minio;Distributed;</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Minio" Version="5.0.0" />
<PackageReference Include="Minio" Version="6.0.1" />
<PackageReference Include="Foundatio" Version="10.6.1" Condition="'$(ReferenceFoundatioSource)' == '' OR '$(ReferenceFoundatioSource)' == 'false'" />

<ProjectReference Include="..\..\..\Foundatio\src\Foundatio\Foundatio.csproj" Condition="'$(ReferenceFoundatioSource)' == 'true'" />
Expand Down
9 changes: 5 additions & 4 deletions src/Foundatio.Minio/Storage/MinioFileStorage.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -13,14 +13,15 @@
using Microsoft.Extensions.Logging.Abstractions;
using Minio;
using Minio.DataModel;
using Minio.DataModel.Args;
using Minio.Exceptions;

namespace Foundatio.Storage {
public class MinioFileStorage : IFileStorage {
private readonly string _bucket;
private readonly bool _shouldAutoCreateBucket;
private bool _bucketExistsChecked;
private readonly MinioClient _client;
private readonly IMinioClient _client;
private readonly ISerializer _serializer;
private readonly ILogger _logger;

Expand All @@ -41,7 +42,7 @@ public MinioFileStorage(Builder<MinioFileStorageOptionsBuilder, MinioFileStorage
: this(builder(new MinioFileStorageOptionsBuilder()).Build()) { }

ISerializer IHaveSerializer.Serializer => _serializer;
public MinioClient Client => _client;
public IMinioClient Client => _client;

private async Task EnsureBucketExists() {
if (!_shouldAutoCreateBucket || _bucketExistsChecked)
Expand Down Expand Up @@ -353,7 +354,7 @@ private SearchCriteria GetRequestCriteria(string searchPattern) {
};
}

private (MinioClient Client, string Bucket) CreateClient(MinioFileStorageOptions options)
private (IMinioClient Client, string Bucket) CreateClient(MinioFileStorageOptions options)
{
var connectionString = new MinioFileStorageConnectionStringBuilder(options.ConnectionString);

Expand Down

0 comments on commit e0ed04c

Please sign in to comment.