Example #1
0
 public RouteStore(RoutingData routingData, Func <IConsulService> serviceFactory,
                   Func <ICurrentState> statsFactory)
 {
     _routingData    = routingData;
     _serviceFactory = serviceFactory;
     _statsFactory   = statsFactory;
 }
Example #2
0
        public CustomRouter(ILoggerFactory factory, RoutingData routingData, IEnumerable <IService> customRoutes)
        {
            _routingData = routingData;
            _log         = factory?.CreateLogger <CustomRouter>();

            foreach (var customRoute in customRoutes)
            {
                AddNewService(customRoute);
            }
        }
Example #3
0
        public RoutingHost(CustomRouter router, CondenserConfiguration config, ILoggerFactory logger,
                           RoutingData routingData, IEnumerable <IService> customRoutes, Func <IConsulService> serviceFactory)
        {
            _routingData      = routingData;
            _serviceFactory   = serviceFactory;
            _logger           = logger?.CreateLogger <RoutingHost>();
            _client.Timeout   = TimeSpan.FromMinutes(6);
            _router           = router;
            _healthCheckUri   = $"http://{config.AgentAddress}:{config.AgentPort}{HttpUtils.HealthAnyUrl}?index=";
            _serviceLookupUri = $"http://{config.AgentAddress}:{config.AgentPort}{HttpUtils.SingleServiceCatalogUrl}";
            var ignore = WatchLoop();

            foreach (var customRoute in customRoutes)
            {
                _router.AddNewService(customRoute);
            }
        }
Example #4
0
 public CustomRouter(ILoggerFactory factory, RoutingData routingData)
 {
     _routingData = routingData;
     _log         = factory?.CreateLogger <CustomRouter>();
 }
Example #5
0
 public Service(Func <string, HttpClient> clientFactory, ILoggerFactory logger, RoutingData routingData)
 {
     _logger        = logger?.CreateLogger <Service>();
     _clientFactory = clientFactory;
     _routingData   = routingData;
 }