public static void AddZooKeeper(this IUraganoSampleBuilder builder) { var client = builder.Configuration.GetSection("Uragano:ServiceDiscovery:ZooKeeper:Client"); var service = builder.Configuration.GetSection("Uragano:ServiceDiscovery:ZooKeeper:Service"); if (service.Exists()) { builder.AddZooKeeper(client, service); } else { builder.AddZooKeeper(client); } }
public static void AddConsul(this IUraganoSampleBuilder builder) { var client = builder.Configuration.GetSection("Uragano:ServiceDiscovery:Consul:Client"); if (!client.Exists()) { throw new ArgumentNullException("Uragano:ServiceDiscovery:Consul:Client"); } var service = builder.Configuration.GetSection("Uragano:ServiceDiscovery:Consul:Service"); if (service.Exists()) { builder.AddConsul(client, service); } else { builder.AddConsul(client); } }
public static void AddRedisPartitionCaching(this IUraganoSampleBuilder builder) { var options = builder.Configuration.GetSection("Uragano:Caching:Redis").Get <RedisOptions>(); builder.AddRedisPartitionCaching(options); }
public static void AddRedisPartitionCaching <TPartitionPolicy>(this IUraganoSampleBuilder builder) where TPartitionPolicy : IRedisPartitionPolicy, new() { var options = builder.Configuration.GetSection("Uragano:Caching:Redis").Get <RedisOptions>(); builder.AddRedisPartitionCaching <TPartitionPolicy>(options); }
public static void AddMemoryCaching(this IUraganoSampleBuilder builder) { var config = builder.Configuration.GetSection("Uragano:Caching:Memory").Get <MemoryCachingOptions>(); builder.AddMemoryCaching(config); }
public static void AddExceptionlessLogger(this IUraganoSampleBuilder builder) { ExceptionlessClient.Default.Configuration.ReadFromConfiguration(builder.Configuration.GetSection("Uragano:Logging:Exceptionless")); builder.AddLogger(new ExceptionlessLoggerProvider(ExceptionlessClient.Default)); }
public static void AddRedisPartitionCaching(this IUraganoSampleBuilder builder, Func <string, IReadOnlyList <RedisConnection>, RedisConnection> partitionPolicy = null) { var options = builder.Configuration.GetSection("Uragano:Caching:Redis").Get <RedisOptions>(); builder.AddRedisPartitionCaching(options, partitionPolicy); }
public static void AddRedisCaching <TKeyGenerator>(this IUraganoSampleBuilder builder) where TKeyGenerator : class, ICachingKeyGenerator { var options = builder.Configuration.GetSection("Uragano:Caching:Redis").Get <RedisOptions>(); builder.AddRedisCaching <TKeyGenerator>(options); }