def get_registry(self) -> Registry: # TODO 定义Registry protocol = self.registry_url.get_param("protocol", "etcd") if protocol == "etcd": return EtcdRegistry(self.registry_url) elif protocol == "direct": return DirectRegistry(self.registry_url) raise RegistryCfgError
def get_registry(self): protocol = self.registry_url.get_param("protocol", "etcd") if protocol == "etcd": return EtcdRegistry(self.registry_url) elif protocol == "direct": return DirectRegistry(self.registry_url)
def test_direct(self): registry = DirectRegistry(url) assert registry.discovery("")["0"] == "127.0.0.1:2379"
def test_direct(self): registry = DirectRegistry(url) assert registry.discovery('')[0] == '127.0.0.1:2379'
def get_registry(self): protocol = self.rurl.get_param('protocol', 'etcd') if protocol == 'etcd': return EtcdRegistry(self.rurl) elif protocol == 'direct': return DirectRegistry(self.rurl)