コード例 #1
0
        public LocalstackSetup(LocalstackSettings settings, IS3ClientFactory s3ClientFactory)
        {
            _settings = settings ?? throw new ArgumentNullException(nameof(settings));
            if (s3ClientFactory == null)
            {
                throw new ArgumentNullException(nameof(s3ClientFactory));
            }

            _s3Client = s3ClientFactory.CreateClient();
        }
コード例 #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "My API", Version = "v1"
                });
            });

            var settings = new LocalstackSettings();

            services.AddSingleton(settings);
            services.AddSingleton(LocalstackS3ClientFactory.CreateClient(settings));

            services.AddTransient <IUploadFile, UploadFile>();
            services.AddTransient <IGetPresignedUrl, GetPresignedUrl>();
        }
コード例 #3
0
 public UploadFile(IAmazonS3 client, LocalstackSettings settings)
 {
     _client   = client;
     _settings = settings;
 }
コード例 #4
0
 public GetPresignedUrl(IAmazonS3 client, LocalstackSettings settings)
 {
     _client   = client;
     _settings = settings;
 }
コード例 #5
0
 public CreateBucket(IAmazonS3 client, LocalstackSettings settings)
 {
     _client   = client;
     _settings = settings;
 }
コード例 #6
0
 public GetTags(IAmazonS3 client, LocalstackSettings settings)
 {
     _client   = client;
     _settings = settings;
 }
コード例 #7
0
 public LocalstackS3ClientFactory(LocalstackSettings settings)
 {
     _settings = settings;
 }
コード例 #8
0
 public GetBucketLocation(IAmazonS3 client, LocalstackSettings settings)
 {
     _client   = client;
     _settings = settings;
 }