ColinChang.OssHelper 1.2.2

Oss Helper for .Net Core, which provide STS,Policy Authentication and common callback functions.

Install-Package ColinChang.OssHelper -Version 1.2.2
dotnet add package ColinChang.OssHelper --version 1.2.2
<PackageReference Include="ColinChang.OssHelper" Version="1.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ColinChang.OssHelper --version 1.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ColinChang.OssHelper, 1.2.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install ColinChang.OssHelper as a Cake Addin
#addin nuget:?package=ColinChang.OssHelper&version=1.2.2

// Install ColinChang.OssHelper as a Cake Tool
#tool nuget:?package=ColinChang.OssHelper&version=1.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

OssHelper

Oss Helper for .Net Core, which provides STS, Policy Authentication, and common callback functions.

Functions

/// <summary>
/// 阿里云OSS STS授权
/// </summary>
/// <returns></returns>
Task<AssumeRoleResponse.AssumeRole_Credentials> GetStsAsync();

/// <summary>
/// 阿里云OSS Policy授权
/// </summary>
/// <returns></returns>
Task<dynamic> GetPolicyAsync(int category);

/// <summary>
/// OSS 通用回调
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<OssObject> CallbackAsync(HttpRequest request);

/// <summary>
/// 流式下载(如果要下载的文件太大,或者一次性下载耗时太长,您可以通过流式下载,一次处理部分内容,直到完成文件的下载)
/// </summary>
/// <param name="objectName"></param>
/// <param name="filename">本地文件存储</param>
/// <returns></returns>
Task DownloadAsync(string objectName, string filename);

/// <summary>
/// 流式下载(如果要下载的文件太大,或者一次性下载耗时太长,您可以通过流式下载,一次处理部分内容,直到完成文件的下载)
/// </summary>
/// <param name="objectName"></param>
/// <returns></returns>
Task<Stream> DownloadAsync(string objectName);

/// <summary>
/// 删除对象
/// </summary>
/// <param name="objectName"></param>
/// <returns></returns>
Task<DeleteObjectResult> DeleteObjectAsync(string objectName);

/// <summary>
/// 删除对象
/// </summary>
/// <param name="objectNames"></param>
/// <returns></returns>
Task<DeleteObjectsResult> DeleteObjectsAsync(IList<string> objectNames);

Sample

we just verify the mime type and size of the uploaded object in the Callback function. about how to use this, please check the Sample project.

be sure you've set your Access information in appsettings.json before running the sample.

Reference

OssHelper

Oss Helper for .Net Core, which provides STS, Policy Authentication, and common callback functions.

Functions

/// <summary>
/// 阿里云OSS STS授权
/// </summary>
/// <returns></returns>
Task<AssumeRoleResponse.AssumeRole_Credentials> GetStsAsync();

/// <summary>
/// 阿里云OSS Policy授权
/// </summary>
/// <returns></returns>
Task<dynamic> GetPolicyAsync(int category);

/// <summary>
/// OSS 通用回调
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<OssObject> CallbackAsync(HttpRequest request);

/// <summary>
/// 流式下载(如果要下载的文件太大,或者一次性下载耗时太长,您可以通过流式下载,一次处理部分内容,直到完成文件的下载)
/// </summary>
/// <param name="objectName"></param>
/// <param name="filename">本地文件存储</param>
/// <returns></returns>
Task DownloadAsync(string objectName, string filename);

/// <summary>
/// 流式下载(如果要下载的文件太大,或者一次性下载耗时太长,您可以通过流式下载,一次处理部分内容,直到完成文件的下载)
/// </summary>
/// <param name="objectName"></param>
/// <returns></returns>
Task<Stream> DownloadAsync(string objectName);

/// <summary>
/// 删除对象
/// </summary>
/// <param name="objectName"></param>
/// <returns></returns>
Task<DeleteObjectResult> DeleteObjectAsync(string objectName);

/// <summary>
/// 删除对象
/// </summary>
/// <param name="objectNames"></param>
/// <returns></returns>
Task<DeleteObjectsResult> DeleteObjectsAsync(IList<string> objectNames);

Sample

we just verify the mime type and size of the uploaded object in the Callback function. about how to use this, please check the Sample project.

be sure you've set your Access information in appsettings.json before running the sample.

Reference

Release Notes

remove ObjectType enum.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ColinChang.OssHelper:

Package Downloads
ColinChang.OssHelper.MultiBucket
an extension for OssHelper to support multiple clients in applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.2 76 4/2/2021
1.2.1 77 3/15/2021
1.2.0 75 3/13/2021
1.1.1 146 12/8/2020
1.1.0 140 12/4/2020
1.0.0 109 11/25/2020