Exemplo n.º 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);
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
 public static HuskyServiceHub AddAliyunOssBucket(this HuskyServiceHub husky, AliyunOssBucketOptions options)
 {
     husky.Services.AddSingleton <ICloudFileBucket>(new AliyunOssBucket(options));
     return(husky);
 }