xBei.OssClient 0.0.5-beta

This is a prerelease version of xBei.OssClient.
dotnet add package xBei.OssClient --version 0.0.5-beta
                    
NuGet\Install-Package xBei.OssClient -Version 0.0.5-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.5-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="xBei.OssClient" Version="0.0.5-beta" />
                    
Directory.Packages.props
<PackageReference Include="xBei.OssClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add xBei.OssClient --version 0.0.5-beta
                    
#r "nuget: xBei.OssClient, 0.0.5-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.
#addin nuget:?package=xBei.OssClient&version=0.0.5-beta&prerelease
                    
Install xBei.OssClient as a Cake Addin
#tool nuget:?package=xBei.OssClient&version=0.0.5-beta&prerelease
                    
Install xBei.OssClient as a Cake Tool

xBei.OssClient

介绍

阿里oss客户端,基于阿里官方sdk封装,支持net8.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 Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.5-beta 56 12/31/2024
0.0.4-beta 56 12/30/2024
0.0.1-beta 136 10/15/2023