added fields to support minio.
This commit is contained in:
parent
d78a90d6f2
commit
017586d1e4
@ -1,4 +1,5 @@
|
|||||||
using Amazon.S3;
|
using Amazon.Runtime;
|
||||||
|
using Amazon.S3;
|
||||||
using Amazon.S3.Model;
|
using Amazon.S3.Model;
|
||||||
using PoweredSoft.Storage.Core;
|
using PoweredSoft.Storage.Core;
|
||||||
using System;
|
using System;
|
||||||
@ -17,6 +18,9 @@ namespace PoweredSoft.Storage.S3
|
|||||||
protected readonly string accessKey;
|
protected readonly string accessKey;
|
||||||
protected readonly string secret;
|
protected readonly string secret;
|
||||||
|
|
||||||
|
protected S3UsEast1RegionalEndpointValue? s3UsEast1RegionalEndpointValue;
|
||||||
|
protected bool forcePathStyle = false;
|
||||||
|
|
||||||
public S3StorageProvider(string endpoint, string bucketName, string accessKey, string secret)
|
public S3StorageProvider(string endpoint, string bucketName, string accessKey, string secret)
|
||||||
{
|
{
|
||||||
this.endpoint = endpoint;
|
this.endpoint = endpoint;
|
||||||
@ -25,11 +29,23 @@ namespace PoweredSoft.Storage.S3
|
|||||||
this.secret = secret;
|
this.secret = secret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetForcePathStyle(bool forcePathStyle)
|
||||||
|
{
|
||||||
|
this.forcePathStyle = forcePathStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetS3UsEast1RegionalEndpointValue(S3UsEast1RegionalEndpointValue value)
|
||||||
|
{
|
||||||
|
this.s3UsEast1RegionalEndpointValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual IAmazonS3 GetClient()
|
protected virtual IAmazonS3 GetClient()
|
||||||
{
|
{
|
||||||
var config = new AmazonS3Config
|
var config = new AmazonS3Config
|
||||||
{
|
{
|
||||||
ServiceURL = endpoint
|
USEast1RegionalEndpointValue = s3UsEast1RegionalEndpointValue,
|
||||||
|
ServiceURL = endpoint,
|
||||||
|
ForcePathStyle = forcePathStyle
|
||||||
};
|
};
|
||||||
var client = new AmazonS3Client(this.accessKey, this.secret, config);
|
var client = new AmazonS3Client(this.accessKey, this.secret, config);
|
||||||
return client;
|
return client;
|
||||||
|
Loading…
Reference in New Issue
Block a user