/// <summary> /// Configures <see cref="EurekaDiscoveryClient"/> as the <see cref="IDiscoveryClient"/> of choice /// </summary> /// <param name="clientBuilder"><see cref="DiscoveryClientBuilder"/></param> /// <param name="serviceInfoName">Optionally specify the name of a specific Eureka service binding</param> public static DiscoveryClientBuilder UseEureka(this DiscoveryClientBuilder clientBuilder, string serviceInfoName = null) { clientBuilder.Extensions.Add(new EurekaDiscoveryClientExtension(serviceInfoName)); return(clientBuilder); }
/// <summary> /// Configures <see cref="KubernetesDiscoveryClient"/> as the <see cref="IDiscoveryClient"/> of choice /// </summary> /// <param name="clientBuilder"><see cref="DiscoveryClientBuilder"/></param> public static DiscoveryClientBuilder UseKubernetes(this DiscoveryClientBuilder clientBuilder) { clientBuilder.Extensions.Add(new KubernetesDiscoveryClientExtension()); return(clientBuilder); }
/// <summary> /// Configures <see cref="ConsulDiscoveryClient"/> as the <see cref="IDiscoveryClient"/> of choice /// </summary> /// <param name="clientBuilder"><see cref="DiscoveryClientBuilder"/></param> public static DiscoveryClientBuilder UseConsul(this DiscoveryClientBuilder clientBuilder) { clientBuilder.Extensions.Add(new ConsulDiscoveryClientExtension()); return(clientBuilder); }
/// <summary> /// Allows the use of IDiscoveryClient model built from IConfiguration instead of a hosted service registry /// </summary> /// <param name="clientBuilder">this</param> /// <remarks> /// Build your list of service instances under the configuration prefix discovery:services<para></para> /// For example: /// "discovery": { /// "services": [ /// { "serviceId": "CartService", "host": "knownhost1", "port": 443, "isSecure": true }, /// { "serviceId": "CartService", "host": "knownhost2", "port": 443, "isSecure": true }, /// ] /// } /// </remarks> public static DiscoveryClientBuilder UseConfiguredInstances(this DiscoveryClientBuilder clientBuilder) { clientBuilder.Extensions.Add(new ConfigurationDiscoveryClientExtension()); return(clientBuilder); }