public QueueCommandReceiver(AwsSettings config, ILogger <QueueCommandReceiver <TCommand> > logger, IAmazonSQS sqs, ICommandHandler <TCommand> commandHandler) { _logger = logger; _config = config; _sqs = sqs; _commandHandler = commandHandler; }
public StationCommandHandler(IOptions <AwsSettings> config, ILogger <StationCommandHandler> logger, IAmazonSQS sqs, IStationService stationService) { _logger = logger; _config = config.Value; _sqs = sqs; _stationService = stationService; }
private static void ConfigureServices(IServiceCollection serviceCollection) { // add logging serviceCollection.AddSingleton(new LoggerFactory() .AddConsole() .AddDebug()); serviceCollection.AddLogging(); // build configuration var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) //.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables() .Build(); var AWSAccountId = configuration.GetValue <string>("AWSAccountId"); // From Environment Variable var appSettings = new AwsSettings { AWSAccountId = AWSAccountId }; //serviceCollection.AddOptions(); //serviceCollection.Configure<AppSettings>(configuration.GetSection("Configuration")); serviceCollection.AddDefaultAWSOptions(configuration.GetAWSOptions()); serviceCollection.AddAWSService <IAmazonSQS>(); // TODO: Make the Services Generic and non Impl specific // add services serviceCollection.AddTransient <IStationService, StationService>(); serviceCollection.AddTransient <IQueueCommandReceiver <CreateStationCommand>, StationQueueCommandReceiver>(); serviceCollection.AddTransient <ICommandHandler <CreateStationCommand>, StationCommandHandler>(); serviceCollection.AddTransient <ICommandHandler <EditStationCommand>, StationCommandHandler>(); serviceCollection.AddTransient <QueueCommandReceiver <EditStationCommand> >(); serviceCollection.AddSingleton <AwsSettings>(appSettings); }
public StationQueueCommandReceiver(AwsSettings config, ILogger <StationQueueCommandReceiver> logger, IAmazonSQS sqs, ICommandHandler <CreateStationCommand> stationCommandHandler) { _logger = logger; _config = config; _sqs = sqs; _stationCommandHandler = stationCommandHandler; }
/// <summary> /// Instantiate the object. /// </summary> /// <param name="aws">AWS settings.</param> public StorageSettings(AwsSettings aws) { if (aws == null) { throw new ArgumentNullException(nameof(aws)); } Aws = aws; }
static void InitializeClient() { switch (_StorageType) { case StorageType.AwsS3: Console.WriteLine("For S3-compatible storage, endpoint should be of the form http://[hostname]:[port]/"); string endpoint = InputString("Endpoint :", null, true); if (String.IsNullOrEmpty(endpoint)) { _AwsSettings = new AwsSettings( InputString("Access key :", null, false), InputString("Secret key :", null, false), InputString("Region :", "USWest1", false), InputString("Bucket :", null, false) ); } else { _AwsSettings = new AwsSettings( endpoint, InputBoolean("SSL :", true), InputString("Access key :", null, false), InputString("Secret key :", null, false), InputString("Region :", "USWest1", false), InputString("Bucket :", null, false) ); } _Blobs = new Blobs(_AwsSettings); break; case StorageType.Azure: _AzureSettings = new AzureSettings( InputString("Account name :", null, false), InputString("Access key :", null, false), InputString("Endpoint URL :", null, false), InputString("Container :", null, false)); _Blobs = new Blobs(_AzureSettings); break; case StorageType.Disk: _DiskSettings = new DiskSettings( InputString("Directory :", null, false)); _Blobs = new Blobs(_DiskSettings); break; case StorageType.Kvpbase: _KvpbaseSettings = new KvpbaseSettings( InputString("Endpoint URL :", null, false), InputString("User GUID :", null, false), InputString("Container :", null, true), InputString("API key :", null, false)); _Blobs = new Blobs(_KvpbaseSettings); break; } }
public MainWalletService(AwsSettings settings) { var region = RegionEndpoint.GetBySystemName(settings.Region); var client = new AmazonDynamoDBClient( settings.AccessId, settings.AccessSecret, region); _mainWalletsTable = Table.LoadTable(client, "main-wallets"); }
public AwsKinesisFactory(IAwsClientFactory clientFactory, IOptions <AwsSettings> awsOptions, IHeartbeatService heartbeatService, ILogger logger) { _clientFactory = clientFactory; _heartbeatService = heartbeatService; _logger = logger; _awsSettings = awsOptions.Value; }
public TransactionService(AwsSettings settings) { var region = RegionEndpoint.GetBySystemName(settings.Region); var client = new AmazonDynamoDBClient( settings.AccessId, settings.AccessSecret, region); _transactionsTable = Table.LoadTable(client, "transactions"); }
/// <summary> /// Initializes a new instance of the <see cref="ListenerService"/> class. /// </summary> /// <param name="serviceProvider">The service provider.</param> /// <param name="actionProcessor">The action processor.</param> /// <param name="loggerFactory">The logger factory.</param> /// <param name="awsSettings">The AWS settings.</param> /// <param name="applicationSettings">The application settings.</param> public ListenerService(IServiceProvider serviceProvider, IActionProcessor actionProcessor, ILoggerFactory loggerFactory, AwsSettings awsSettings, ApplicationSettings applicationSettings) { ServiceProvider = serviceProvider; Logger = loggerFactory.CreateLogger <ListenerService>(); AwsSettings = awsSettings; ApplicationSettings = applicationSettings; ActionProcessor = actionProcessor; }
private void InitializeBlobs() { if (String.IsNullOrEmpty(Endpoint)) { _AwsSettings = new AwsSettings(AccessKey, SecretKey, Region, Bucket); } else { _AwsSettings = new AwsSettings(Endpoint, Ssl, AccessKey, SecretKey, Region.ToString(), Bucket, BaseUrl); } _Blobs = new Blobs(_AwsSettings); }
public AwsClientFactory(IOptions <AwsSettings> awsOptions) { _settings = awsOptions.Value; }
public WalletEventHandler(AwsSettings settings) { _mainWalletService = new MainWalletService(settings); _transactionService = new TransactionService(settings); }
public LarmSettings() { Aws = new AwsSettings(); Index = new IndexSettings(); }
public StandupsController(IOptions <AwsSettings> awsOptions) { _awsSettings = awsOptions.Value; _dynamoClient = new AmazonDynamoDBClient(new BasicAWSCredentials(_awsSettings.AccessKey, _awsSettings.SecretKey), RegionEndpoint.USEast1); }
public StationCommandPublisher(AwsSettings config, ILogger <StationCommandPublisher> logger, IAmazonSQS sqs) { _logger = logger; _config = config; _sqs = sqs; }
public AwsS3Service(IOptions <AwsSettings> awsSettings) { _awSettings = awsSettings.Value; _s3Client = new AmazonS3Client(RegionEndpoint.GetBySystemName(_awSettings.Region)); }