Esempio n. 1
0
        public static IConveyBuilder AddServiceClient <T>(this IConveyBuilder builder, string serviceName,
                                                          string sectionName           = SectionName, string consulSectionName = "consul", string fabioSectionName = "fabio",
                                                          string httpClientSectionName = "httpClient")
            where T : class
        {
            var restEaseOptions = builder.GetOptions <RestEaseOptions>(sectionName);

            return(builder.AddServiceClient <T>(serviceName, restEaseOptions,
                                                b => b.AddFabio(fabioSectionName, consulSectionName, httpClientSectionName)));
        }
Esempio n. 2
0
        public static IConveyBuilder AddServiceClient <T>(this IConveyBuilder builder, string serviceName,
                                                          Func <IRestEaseOptionsBuilder, IRestEaseOptionsBuilder> buildOptions,
                                                          Func <IConsulOptionsBuilder, IConsulOptionsBuilder> buildConsulOptions,
                                                          Func <IFabioOptionsBuilder, IFabioOptionsBuilder> buildFabioOptions,
                                                          HttpClientOptions httpClientOptions)
            where T : class
        {
            var options = buildOptions(new RestEaseOptionsBuilder()).Build();

            return(builder.AddServiceClient <T>(serviceName, options,
                                                b => b.AddFabio(buildFabioOptions, buildConsulOptions, httpClientOptions)));
        }
Esempio n. 3
0
 public static IConveyBuilder AddServiceClient <T>(this IConveyBuilder builder, string serviceName,
                                                   RestEaseOptions options, ConsulOptions consulOptions, FabioOptions fabioOptions,
                                                   HttpClientOptions httpClientOptions)
     where T : class
 => builder.AddServiceClient <T>(serviceName, options,
                                 b => b.AddFabio(fabioOptions, consulOptions, httpClientOptions));