Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
        public static void AddRedisPartitionCaching(this IUraganoSampleBuilder builder)
        {
            var options = builder.Configuration.GetSection("Uragano:Caching:Redis").Get <RedisOptions>();

            builder.AddRedisPartitionCaching(options);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        public static void AddMemoryCaching(this IUraganoSampleBuilder builder)
        {
            var config = builder.Configuration.GetSection("Uragano:Caching:Memory").Get <MemoryCachingOptions>();

            builder.AddMemoryCaching(config);
        }
Esempio n. 6
0
 public static void AddExceptionlessLogger(this IUraganoSampleBuilder builder)
 {
     ExceptionlessClient.Default.Configuration.ReadFromConfiguration(builder.Configuration.GetSection("Uragano:Logging:Exceptionless"));
     builder.AddLogger(new ExceptionlessLoggerProvider(ExceptionlessClient.Default));
 }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
        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);
        }