Exemple #1
0
        public static IConveyBuilder AddConsul(this IConveyBuilder builder,
                                               Func <IConsulOptionsBuilder, IConsulOptionsBuilder> buildOptions, HttpClientOptions httpClientOptions)
        {
            var options = buildOptions(new ConsulOptionsBuilder()).Build();

            return(builder.AddConsul(options, httpClientOptions));
        }
Exemple #2
0
        public static IConveyBuilder AddConsul(this IConveyBuilder builder, string sectionName = SectionName,
                                               string httpClientSectionName = "httpClient")
        {
            var consulOptions     = builder.GetOptions <ConsulOptions>(sectionName);
            var httpClientOptions = builder.GetOptions <HttpClientOptions>(httpClientSectionName);

            return(builder.AddConsul(consulOptions, httpClientOptions));
        }
Exemple #3
0
        public static IConveyBuilder AddConsul(this IConveyBuilder builder, string sectionName = SectionName,
                                               string httpClientSectionName = "httpClient")
        {
            if (string.IsNullOrWhiteSpace(sectionName))
            {
                sectionName = SectionName;
            }

            var consulOptions     = builder.GetOptions <ConsulOptions>(sectionName);
            var httpClientOptions = builder.GetOptions <HttpClientOptions>(httpClientSectionName);

            return(builder.AddConsul(consulOptions, httpClientOptions));
        }
Exemple #4
0
        public static IConveyBuilder AddInfrastructure(this IConveyBuilder builder)
        {
            builder.AddConsul();

            return(builder);
        }