Optimify.Aws.S3FileSystem
6.0.0
dotnet add package Optimify.Aws.S3FileSystem --version 6.0.0
NuGet\Install-Package Optimify.Aws.S3FileSystem -Version 6.0.0
<PackageReference Include="Optimify.Aws.S3FileSystem" Version="6.0.0" />
paket add Optimify.Aws.S3FileSystem --version 6.0.0
#r "nuget: Optimify.Aws.S3FileSystem, 6.0.0"
// Install Optimify.Aws.S3FileSystem as a Cake Addin
#addin nuget:?package=Optimify.Aws.S3FileSystem&version=6.0.0
// Install Optimify.Aws.S3FileSystem as a Cake Tool
#tool nuget:?package=Optimify.Aws.S3FileSystem&version=6.0.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
Please report any bugs on dev@optimify.cz. You can also find us here https://www.optimify.cz/en.
Every suggestion to improve this package is also welcomed. This package is distributed for free for anyone to use and modify.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- AWSSDK.S3 (>= 3.7.8.10)
- Microsoft.AspNetCore.Http.Features (>= 5.0.15)
- Microsoft.AspNetCore.Mvc (>= 2.2.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Options (>= 6.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0.0)
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 |
Migration to Dotnet 6 and new libraries