update version

This commit is contained in:
tongchenfei
2021-02-24 15:10:37 +08:00
parent 8d71289338
commit ed7df6ebd0
3 changed files with 15 additions and 15 deletions

View File

@@ -1,14 +1,14 @@
package com.mogo.cloud.httpdns
import com.mogo.cloud.httpdns.listener.IMogoHttpDns
import java.lang.IllegalStateException
object MogoHttpDnsClient : IMogoHttpDns {
private var httpDnsHelper:HttpDnsHelper? = null
private var httpDnsHelper: HttpDnsHelper? = null
fun init(config: MogoHttpDnsConfig) {
if(httpDnsHelper == null) {
// httpdns init
if (httpDnsHelper == null) {
httpDnsHelper = HttpDnsHelper(config)
}
}
@@ -16,7 +16,7 @@ object MogoHttpDnsClient : IMogoHttpDns {
/**
* 先从本地缓存中根据type和host获取ip:port如果本地缓存中没有再通过网络获取
*/
fun getHttpDnsAddressUseCacheIfNecessary(type: Int, _host: String):String?{
fun getHttpDnsAddressUseCacheIfNecessary(type: Int, _host: String): String? {
return getHttpDnsCachedAddress(type, _host) ?: return getHttpDnsAddress(type, _host)
}
@@ -24,7 +24,7 @@ object MogoHttpDnsClient : IMogoHttpDns {
if (httpDnsHelper == null) {
throw IllegalStateException("MogoHttpDnsClient init error")
}
return httpDnsHelper!!.getHttpDnsAddress(type,_host)
return httpDnsHelper!!.getHttpDnsAddress(type, _host)
}
override fun getHttpDnsCachedAddress(type: Int, _host: String): String? {