Optimify.Aws.S3FileSystem
1.2.0
See the version list below for details.
dotnet add package Optimify.Aws.S3FileSystem --version 1.2.0
NuGet\Install-Package Optimify.Aws.S3FileSystem -Version 1.2.0
<PackageReference Include="Optimify.Aws.S3FileSystem" Version="1.2.0" />
paket add Optimify.Aws.S3FileSystem --version 1.2.0
#r "nuget: Optimify.Aws.S3FileSystem, 1.2.0"
// Install Optimify.Aws.S3FileSystem as a Cake Addin
#addin nuget:?package=Optimify.Aws.S3FileSystem&version=1.2.0
// Install Optimify.Aws.S3FileSystem as a Cake Tool
#tool nuget:?package=Optimify.Aws.S3FileSystem&version=1.2.0
Introduction
Simple project to help setting up S3 connection quickly. Good for connecting application to SINGLE AWS S3 bucket and performing file system-like operations on it. All operations that depends on AWS S3 server are fully asynchronous.
Getting Started
- In your appsettings.json, create following record "AwsCredentials" record with following structure:
"AwsCredentials": {
"BucketName": "bucket-name",
"AccessKey": "OPTIMIFYAAAAAAAAA",
"SecretAccessKey": "optimify2020dsadasdasdasdas",
"Region": "eu-central-1"
}
- Register S3FileSystem in your services, insert IConfiguration into the method (it will load data from your appsettings.json):
public static void ResolveDependencyInjection(this IServiceCollection services, IConfiguration configuration)
{
services.AddS3FileSystem(configuration);
}
- Inject S3FileSystem and start using it:
public MyClassConstructor(IAwsFileSystem awsFileSystem)
{
_awsFileSystem = awsFileSystem;
}
public async Task<Result> DeleteImageAsync(string imagePath)
{
var res = await _awsFileSystem.DeleteFile(imagePath);
if (res.Errored) return res.ErrorResult;
return Result.WithoutError;
}
Error handling
This package is designed not to throw exceptions. Instead, all AWS-dependent method results are wrap in Result<TValue> class. Before processing the returned data, please check if the wrapper errored and handle the error accordingly.
Contribute
This package is distributed for free to anyone use and modify. Please report any bugs on dev@optimify.cz. Every suggestion to improve this package is also welcomed.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- AWSSDK.S3 (>= 3.5.3.10)
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.9)
- Microsoft.Extensions.DependencyInjection (>= 3.1.9)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 3.1.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
6.0.0 | 632 | 3/22/2022 |
5.0.2 | 456 | 5/29/2021 |
5.0.1-alpha | 289 | 5/29/2021 |
5.0.0-alpha | 304 | 5/29/2021 |
1.3.1 | 331 | 4/16/2021 |
1.3.0 | 307 | 4/16/2021 |
1.2.0 | 319 | 3/25/2021 |
1.1.0 | 475 | 11/23/2020 |
1.0.0 | 442 | 11/2/2020 |
Added file upload presigned url