xBei.OssClient
0.0.1-beta
This is a prerelease version of xBei.OssClient.
dotnet add package xBei.OssClient --version 0.0.1-beta
NuGet\Install-Package xBei.OssClient -Version 0.0.1-beta
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="xBei.OssClient" Version="0.0.1-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add xBei.OssClient --version 0.0.1-beta
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: xBei.OssClient, 0.0.1-beta"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install xBei.OssClient as a Cake Addin #addin nuget:?package=xBei.OssClient&version=0.0.1-beta&prerelease // Install xBei.OssClient as a Cake Tool #tool nuget:?package=xBei.OssClient&version=0.0.1-beta&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
xBei.OssClient
介绍
阿里oss客户端,基于阿里官方sdk封装,支持net6.0;net7.0。 主要封装了Object相关操作,支持依赖注入。
开发中
使用
安装:PM > Install-Package xBei.OssClient
使用依赖注入
配置appsettings.json
{
"OssSettings": {
"Services":{
"xbei-img":{
"AccessKeyId": "AccessKeyId",
"AccessKeySecret": "Secret",
"EndPoint": "oss-cn-shanghai.aliyuncs.com",
"BucketName": "xbei-img",
"ImageHost": "https://i.xbei.net"
}
}
}
}
注册服务:
services.Configure<AliOssSettings>(configuration.GetSection("OssSettings"));
services.AddSingleton<AliOssClient>();
直接初始化
//STS临时授权
var ossClient = new AliOssClient(new AliOssSettings.Config {
AccessKeyId = "AccessKeyId",
AccessKeySecret = "AccessKeySecret",
SecurityToken = "SecurityToken",
EndPoint = "oss-cn-hangzhou.aliyuncs.com",
BucketName = "Bucket",
ImageHost = "https://i.xbei.net",
Path = "Path",
Expiration = "Expiration",
IsDefault = true,
}, logger);
//AK授权
var ossClient = new AliOssClient(new AliOssSettings.Config {
AccessKeyId = "AccessKeyId",
AccessKeySecret = "AccessKeySecret",
EndPoint = "oss-cn-shanghai.aliyuncs.com",
BucketName = "Bucket",
ImageHost = "https://i.xbei.net",
IsDefault = true,
}, logger);
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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Aliyun.OSS.SDK.NetCore (>= 2.13.0)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.1)
- Microsoft.Extensions.Options (>= 7.0.1)
-
net7.0
- Aliyun.OSS.SDK.NetCore (>= 2.13.0)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.1)
- Microsoft.Extensions.Options (>= 7.0.1)
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 |
---|---|---|
0.0.1-beta | 129 | 10/15/2023 |