public LocalstackSetup(LocalstackSettings settings, IS3ClientFactory s3ClientFactory) { _settings = settings ?? throw new ArgumentNullException(nameof(settings)); if (s3ClientFactory == null) { throw new ArgumentNullException(nameof(s3ClientFactory)); } _s3Client = s3ClientFactory.CreateClient(); }
// 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>(); }
public UploadFile(IAmazonS3 client, LocalstackSettings settings) { _client = client; _settings = settings; }
public GetPresignedUrl(IAmazonS3 client, LocalstackSettings settings) { _client = client; _settings = settings; }
public CreateBucket(IAmazonS3 client, LocalstackSettings settings) { _client = client; _settings = settings; }
public GetTags(IAmazonS3 client, LocalstackSettings settings) { _client = client; _settings = settings; }
public LocalstackS3ClientFactory(LocalstackSettings settings) { _settings = settings; }
public GetBucketLocation(IAmazonS3 client, LocalstackSettings settings) { _client = client; _settings = settings; }