public ClientDefaultInterceptor(ILoadBalancing loadBalancing, IClientFactory clientFactory, ICircuitBreaker circuitBreaker, UraganoSettings uraganoSettings) { LoadBalancing = loadBalancing; ClientFactory = clientFactory; CircuitBreaker = circuitBreaker; UraganoSettings = uraganoSettings; }
public RedisPartitionCaching(UraganoSettings uraganoSettings, IServiceProvider serviceProvider, ICodec codec, IConsistentHash <RedisConnection> consistentHash) { Codec = codec; var redisOptions = (RedisOptions)uraganoSettings.CachingOptions; ConsistentHash = consistentHash; var policy = serviceProvider.GetService <Func <string, IEnumerable <RedisConnection>, RedisConnection> >(); if (policy == null) { foreach (var item in redisOptions.ConnectionStrings) { ConsistentHash.AddNode(item, item.ToString()); } policy = (key, connections) => ConsistentHash.GetNodeForKey(key); } string NodeRule(string key) { var connection = policy(key, redisOptions.ConnectionStrings); return($"{connection.Host}:{connection.Port}/{connection.DefaultDatabase}"); } RedisHelper.Initialization(new CSRedis.CSRedisClient(NodeRule, redisOptions.ConnectionStrings.Select(p => p.ToString()).ToArray())); Cache = new Microsoft.Extensions.Caching.Redis.CSRedisCache(RedisHelper.Instance); }
public RemotingInvoke(ILoadBalancing loadBalancing, IClientFactory clientFactory, IServiceFactory serviceFactory, UraganoSettings uraganoSettings, IServiceProvider serviceProvider) { LoadBalancing = loadBalancing; ClientFactory = clientFactory; ServiceFactory = serviceFactory; UraganoSettings = uraganoSettings; ServiceProvider = serviceProvider; }
public ConsulFixture() { UraganoSettings = new UraganoSettings { //ServiceDiscoveryClientConfiguration = new ConsulClientConfigure //{ // Address = new Uri("http://192.168.1.254:8500"), // Token = "5ece74af-19d1-0e61-b25c-b9665d29f50b" //}, ServerSettings = new ServerSettings { Address = "127.0.0.1", Port = 1000 } }; }
public ConsulServiceDiscovery(UraganoSettings uraganoSettings, ILogger <ConsulServiceDiscovery> logger, IServiceDiscoveryClientConfiguration clientConfiguration, IServiceProvider service) { if (!(clientConfiguration is ConsulClientConfigure client)) { throw new ArgumentNullException(nameof(clientConfiguration)); } var agent = service.GetService <IServiceRegisterConfiguration>(); if (agent != null) { if (!(agent is ConsulRegisterServiceConfiguration serviceAgent)) { throw new ArgumentNullException(nameof(ConsulRegisterServiceConfiguration)); } ConsulRegisterServiceConfiguration = serviceAgent; } ConsulClientConfigure = client; ServerSettings = uraganoSettings.ServerSettings; Logger = logger; }
public RedisPartitionCaching(UraganoSettings uraganoSettings, IServiceProvider serviceProvider) { var redisOptions = (RedisOptions)uraganoSettings.CachingOptions; var policy = serviceProvider.GetService <IRedisPartitionPolicy>(); if (policy != null) { string NodeRule(string key) { var connection = policy.Policy(key, redisOptions.ConnectionStrings); return($"{connection.Host}:{connection.Port}/{connection.DefaultDatabase}"); } RedisHelper.Initialization(new CSRedis.CSRedisClient(NodeRule, redisOptions.ConnectionStrings.Select(p => p.ToString()).ToArray())); } else { RedisHelper.Initialization(new CSRedis.CSRedisClient(NodeRule: null, redisOptions.ConnectionStrings.Select(p => p.ToString()).ToArray())); } Cache = new Microsoft.Extensions.Caching.Redis.CSRedisCache(RedisHelper.Instance); }
public InitializationPartitionRedis(IRedisPartitionPolicy redisPartitionPolicy, UraganoSettings uraganoSettings, IServiceCollection serviceCollection) { RedisOptions = (RedisOptions)uraganoSettings.CachingOptions; RedisPartitionPolicy = redisPartitionPolicy; ServiceCollection = serviceCollection; }
public DotNettyBootstrapStartup(UraganoSettings uraganoSettings, IBootstrap bootstrap) { UraganoSettings = uraganoSettings; Bootstrap = bootstrap; }
public ServerBootstrap(IServiceFactory serviceFactory, IServiceProvider serviceProvider, UraganoSettings uraganoSettings, ILogger <ServerBootstrap> logger, ICodec codec) { ServiceFactory = serviceFactory; ServiceProvider = serviceProvider; ServerSettings = uraganoSettings.ServerSettings; Logger = logger; Codec = codec; }
public ServiceDiscoveryStartup(IServiceDiscovery serviceDiscovery, UraganoSettings uraganoSettings) { ServiceDiscovery = serviceDiscovery; ServerSettings = uraganoSettings.ServerSettings; }
public CachingDefaultInterceptor(ICaching caching, ICachingKeyGenerator keyGenerator, UraganoSettings uraganoSettings, IServiceFactory serviceFactory) { Caching = caching; KeyGenerator = keyGenerator; CachingOptions = uraganoSettings.CachingOptions; ServiceFactory = serviceFactory; }
public ZooKeeperServiceDiscovery(ICodec codec, ILogger <ZooKeeperServiceDiscovery> logger, UraganoSettings uraganoSettings, IServiceDiscoveryClientConfiguration clientConfiguration, IServiceProvider service) { if (!(clientConfiguration is ZooKeeperClientConfigure client)) { throw new ArgumentNullException(nameof(clientConfiguration)); } ZooKeeperClientConfigure = client; var agent = service.GetService <IServiceRegisterConfiguration>(); if (agent != null) { if (!(agent is ZooKeeperRegisterServiceConfiguration serviceAgent)) { throw new ArgumentNullException(nameof(ZooKeeperRegisterServiceConfiguration)); } ZooKeeperRegisterServiceConfiguration = serviceAgent; } ZooKeeperWatcher = new UraganoWatcher(); ZooKeeperWatcher.OnChange += Watcher_OnChange;; ServerSettings = uraganoSettings.ServerSettings; Codec = codec; Logger = logger; CreateZooKeeperClient(); }
public RemotingInvoke(IServiceFactory serviceFactory, UraganoSettings uraganoSettings, IServiceProvider serviceProvider) { ServiceFactory = serviceFactory; UraganoSettings = uraganoSettings; ServiceProvider = serviceProvider; }
public ServiceStatusManageFactory(ILogger <ServiceStatusManageFactory> logger, IServiceDiscovery serviceDiscovery, UraganoSettings uraganoSettings) { Logger = logger; ServiceDiscovery = serviceDiscovery; UraganoSettings = uraganoSettings; }
public ServiceStatusManageStartup(IServiceStatusManageFactory serviceStatusManageFactory, UraganoSettings uraganoSettings, ILogger <ServiceStatusManageStartup> logger) { ServiceStatusManageFactory = serviceStatusManageFactory; UraganoSettings = uraganoSettings; Logger = logger; }
public ConsulServiceDiscovery(UraganoSettings uraganoSettings, ILogger <ConsulServiceDiscovery> logger) { UraganoSettings = uraganoSettings; Logger = logger; }
public RedisCaching(ICodec codec, UraganoSettings uraganoSettings) { Codec = codec; RedisHelper.Initialization(new CSRedis.CSRedisClient(((RedisOptions)uraganoSettings.CachingOptions).ConnectionStrings.First().ToString())); }
public ServiceBuilder(IServiceFactory serviceFactory, IServiceProvider serviceProvider, UraganoSettings uraganoSettings) { ServiceFactory = serviceFactory; ServiceProvider = serviceProvider; UraganoSettings = uraganoSettings; }
public ServiceFactory(IServiceProvider serviceProvider, UraganoSettings uraganoSettings, IScriptInjection scriptInjection) { ServiceProvider = serviceProvider; UraganoSettings = uraganoSettings; ScriptInjection = scriptInjection; }
public InfrastructureStartup(UraganoSettings uraganoSettings, ILoggerFactory loggerFactory) { UraganoSettings = uraganoSettings; LoggerFactory = loggerFactory; }
public InitializationRedis(UraganoSettings uraganoSettings) { RedisOptions = (RedisOptions)uraganoSettings.CachingOptions; }