public static void AddFirstPartyServices( this IServiceCollection services, IHostingEnvironment env, IConfigurationRoot config) { ConfigureAuth(services, config); if (env.IsDevelopment()) { services.AddDbContext <IncidentContext>(options => options.UseInMemoryDatabase("Live")); } if (env.IsStaging()) { services.AddDbContext <IncidentContext>(options => options.UseSqlServer(config.GetConnectionString("incidentStaging"))); } services.AddTicketingConnector(env, config); services.AddSingleton <IConfigurationRoot>(i => config); var httpClients = new HttpClientLookup(); if (TryGetConfigValue(config, "Services:Playbook", out string playbookBaseUrl)) { httpClients.RegisterEndpoint("Playbook", playbookBaseUrl); } services.AddSingleton(httpClients); }
public static IServiceCollection AddMicroserviceProxies(this IServiceCollection services, GatewayConfiguration config) { var httpClients = new HttpClientLookup(); if (!String.IsNullOrEmpty(config.Services.Playbook)) { httpClients.RegisterEndpoint(nameof(config.Services.Playbook), config.Services.Playbook); } return(services.AddSingleton(httpClients)); }
protected ProxyHandler(HttpClientLookup clientFactory, string endpointName) : base(clientFactory, endpointName) { }
protected ProxyHandlerBase(HttpClientLookup clientFactory, string endpointName) { _client = clientFactory.GetClientForEndpoint(endpointName); }
protected PlaybookProxyHandler(HttpClientLookup clientFactory) : base(clientFactory, PlaybookEndpointName) { }
public GetGlobalActionsHandler(HttpClientLookup clientFactory) : base(clientFactory) { }
public GetEventTypeHandler(HttpClientLookup clientFactory) : base(clientFactory) { }