コード例 #1
0
 public QueueCommandReceiver(AwsSettings config, ILogger <QueueCommandReceiver <TCommand> > logger, IAmazonSQS sqs, ICommandHandler <TCommand> commandHandler)
 {
     _logger         = logger;
     _config         = config;
     _sqs            = sqs;
     _commandHandler = commandHandler;
 }
コード例 #2
0
 public StationCommandHandler(IOptions <AwsSettings> config, ILogger <StationCommandHandler> logger, IAmazonSQS sqs, IStationService stationService)
 {
     _logger         = logger;
     _config         = config.Value;
     _sqs            = sqs;
     _stationService = stationService;
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 public StationQueueCommandReceiver(AwsSettings config, ILogger <StationQueueCommandReceiver> logger, IAmazonSQS sqs, ICommandHandler <CreateStationCommand> stationCommandHandler)
 {
     _logger = logger;
     _config = config;
     _sqs    = sqs;
     _stationCommandHandler = stationCommandHandler;
 }
コード例 #5
0
ファイル: StorageSettings.cs プロジェクト: jchristn/komodo
        /// <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;
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: fengweijp/BlobHelper
        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;
            }
        }
コード例 #7
0
        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");
        }
コード例 #8
0
 public AwsKinesisFactory(IAwsClientFactory clientFactory,
                          IOptions <AwsSettings> awsOptions,
                          IHeartbeatService heartbeatService,
                          ILogger logger)
 {
     _clientFactory    = clientFactory;
     _heartbeatService = heartbeatService;
     _logger           = logger;
     _awsSettings      = awsOptions.Value;
 }
コード例 #9
0
        public TransactionService(AwsSettings settings)
        {
            var region = RegionEndpoint.GetBySystemName(settings.Region);
            var client = new AmazonDynamoDBClient(
                settings.AccessId,
                settings.AccessSecret,
                region);

            _transactionsTable = Table.LoadTable(client, "transactions");
        }
コード例 #10
0
 /// <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;
 }
コード例 #11
0
        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);
        }
コード例 #12
0
 public AwsClientFactory(IOptions <AwsSettings> awsOptions)
 {
     _settings = awsOptions.Value;
 }
コード例 #13
0
 public WalletEventHandler(AwsSettings settings)
 {
     _mainWalletService  = new MainWalletService(settings);
     _transactionService = new TransactionService(settings);
 }
コード例 #14
0
	    public LarmSettings()
	    {
	        Aws = new AwsSettings();
            Index = new IndexSettings();
	    }
コード例 #15
0
 public StandupsController(IOptions <AwsSettings> awsOptions)
 {
     _awsSettings  = awsOptions.Value;
     _dynamoClient = new AmazonDynamoDBClient(new BasicAWSCredentials(_awsSettings.AccessKey, _awsSettings.SecretKey), RegionEndpoint.USEast1);
 }
コード例 #16
0
 public StationCommandPublisher(AwsSettings config, ILogger <StationCommandPublisher> logger, IAmazonSQS sqs)
 {
     _logger = logger;
     _config = config;
     _sqs    = sqs;
 }
コード例 #17
0
ファイル: AwsS3Service.cs プロジェクト: MrZablah/CMCore
 public AwsS3Service(IOptions <AwsSettings> awsSettings)
 {
     _awSettings = awsSettings.Value;
     _s3Client   = new AmazonS3Client(RegionEndpoint.GetBySystemName(_awSettings.Region));
 }