public GCloudContentScanTaskService(IOptionsMonitor <GoogleTasksConfiguration> optionsMonitor, CloudTasksClient cloudTasksClient, IOptionsMonitor <ServerConfiguration> serverConfigurationOptionsMonitor) { this.googleTasksConfiguration = optionsMonitor.CurrentValue; this.cloudTasksClient = cloudTasksClient; this.serverConfiguration = serverConfigurationOptionsMonitor.CurrentValue; }
public static void AddGCloudServices(this IServiceCollection services, GoogleTasksConfiguration configuration, ImageServiceConfiguration imageServiceConfiguration) { Environment.SetEnvironmentVariable(configuration.KeyEnvironmentVariableName, configuration.KeyPath); CloudTasksClientBuilder cloudTasksClientBuilder = new CloudTasksClientBuilder { CredentialsPath = configuration.KeyPath }; services.AddHttpClient(Constants.IMAGES_MICROSERVICE_HTTP_CLIENT_NAME, client => { client.BaseAddress = new Uri(imageServiceConfiguration.Url); }); services.AddScoped(s => cloudTasksClientBuilder.Build()); }