Beispiel #1
0
        public static HuskyServiceHub AddAliyunOssBucket(this HuskyServiceHub husky, Action <AliyunOssBucketOptions> setupAction)
        {
            var options = new AliyunOssBucketOptions();

            setupAction(options);
            husky.Services.AddSingleton <ICloudFileBucket>(new AliyunOssBucket(options));
            return(husky);
        }
Beispiel #2
0
        private static AliyunOssBucket BuildAliyunOssService()
        {
            var options = new AliyunOssBucketOptions {
                AccessKeyId       = "",
                AccessKeySecret   = "",
                DefaultBucketName = "",
                Endpoint          = "oss-cn-hangzhou.aliyuncs.com",
            };

            return(string.IsNullOrEmpty(options.AccessKeyId) || string.IsNullOrEmpty(options.AccessKeySecret)
                                ? null
                                : new AliyunOssBucket(options));
        }
Beispiel #3
0
 public static HuskyServiceHub AddAliyunOssBucket(this HuskyServiceHub husky, AliyunOssBucketOptions options)
 {
     husky.Services.AddSingleton <ICloudFileBucket>(new AliyunOssBucket(options));
     return(husky);
 }