diff options
Diffstat (limited to 'core-rest/src/main/scala/xyz/driver/core/rest/DnsDiscovery.scala')
-rw-r--r-- | core-rest/src/main/scala/xyz/driver/core/rest/DnsDiscovery.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core-rest/src/main/scala/xyz/driver/core/rest/DnsDiscovery.scala b/core-rest/src/main/scala/xyz/driver/core/rest/DnsDiscovery.scala new file mode 100644 index 0000000..87946e4 --- /dev/null +++ b/core-rest/src/main/scala/xyz/driver/core/rest/DnsDiscovery.scala @@ -0,0 +1,11 @@ +package xyz.driver.core +package rest + +class DnsDiscovery(transport: HttpRestServiceTransport, overrides: Map[String, String]) { + + def discover[A](implicit descriptor: ServiceDescriptor[A]): A = { + val url = overrides.getOrElse(descriptor.name, s"https://${descriptor.name}") + descriptor.connect(transport, url) + } + +} |