Example #1
0
 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
Example #2
0
 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)
Example #3
0
 def test_direct(self):
     registry = DirectRegistry(url)
     assert registry.discovery("")["0"] == "127.0.0.1:2379"
Example #4
0
 def test_direct(self):
     registry = DirectRegistry(url)
     assert registry.discovery('')[0] == '127.0.0.1:2379'
Example #5
0
 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)