public override Task <KafkaService> Locate(string serviceName) { string longName; if (string.IsNullOrWhiteSpace(serviceName)) { longName = serviceName = "_kafka"; } else { longName = $"{serviceName.ToLowerInvariant()}._kafka"; } // get name of service to resolve ServiceDnsName name = new ServiceDnsName { Domain = ServiceDomain, ServiceName = serviceName, Protocol = "kafka", DnsName = string.IsNullOrEmpty(ServiceDomain) ? serviceName.ToLowerInvariant() : $"{longName}._tcp.{ServiceDomain}" }; return(Locate(name, _ => ServiceLookup.SrvTxt(name, KafkaServiceFactory))); }
public Task <DatabaseService> Locate(string serviceName, string protocol) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } if (string.IsNullOrWhiteSpace(protocol)) { throw new ArgumentNullException(nameof(protocol)); } // lower-invariant protocol protocol = protocol.ToLowerInvariant(); // get name of service to resolve ServiceDnsName name = new ServiceDnsName { Domain = ServiceDomain, ServiceName = serviceName, Protocol = protocol, DnsName = string.IsNullOrEmpty(ServiceDomain) ? serviceName.ToLowerInvariant() : $"{serviceName.ToLowerInvariant()}._{protocol}._tcp.{ServiceDomain}" }; // locate and return return(Locate(name, _ => ServiceLookup.SrvTxt(name, DbServiceFactory))); }
public Task <DatabaseService> Locate(DatabaseProtocol protocol) { // lower-invariant protocol & service name string protocolName = protocol.ToString().ToLowerInvariant(); string serviceName = $"_{protocolName}"; // get name of service to resolve ServiceDnsName name = new ServiceDnsName { Domain = ServiceDomain, ServiceName = serviceName, Protocol = protocolName, DnsName = string.IsNullOrEmpty(ServiceDomain) ? serviceName.ToLowerInvariant() : $"{serviceName.ToLowerInvariant()}._tcp.{ServiceDomain}" }; // locate and return return(Locate(name, _ => ServiceLookup.SrvTxt(name, DbServiceFactory))); }
public override Task <WebApiService> Locate(string serviceName) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } // get name of service to resolve ServiceDnsName name = new ServiceDnsName { Domain = ServiceDomain, ServiceName = serviceName, Protocol = "http", DnsName = string.IsNullOrEmpty(ServiceDomain) ? serviceName.ToLowerInvariant() : $"{serviceName.ToLowerInvariant()}._http._tcp.{ServiceDomain}" }; return(Locate(name, _ => ServiceLookup.SrvTxt(name, WebApiServiceFactory))); }
public Task <GenericService> Locate(string serviceName, IpProtocol protocol) { if (string.IsNullOrWhiteSpace(serviceName)) { throw new ArgumentNullException(nameof(serviceName)); } // get name of service to resolve string sProtocol = protocol.ToString().ToLowerInvariant(); ServiceDnsName name = new ServiceDnsName { Domain = ServiceDomain, ServiceName = serviceName, Protocol = sProtocol, DnsName = string.IsNullOrEmpty(ServiceDomain) ? serviceName.ToLowerInvariant() : $"{serviceName.ToLowerInvariant()}._{sProtocol}.{ServiceDomain}" }; return(Locate(name, _ => ServiceLookup.SrvTxt(name, MyServiceFactory))); }
internal override SrvLookup <GrpcService> LocateFunction(string dnsName) => ServiceLookup.SrvTxt(Name, Factory);