54 lines
1.1 KiB
Java
54 lines
1.1 KiB
Java
package com.mogo.httpdns;
|
||
|
||
import androidx.annotation.Keep;
|
||
|
||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||
import com.mogo.cloud.httpdns.listener.OnAddressChangedListener;
|
||
|
||
/**
|
||
* @author congtaowang
|
||
* @since 2020/11/18
|
||
* <p>
|
||
* http 请求做http dns转换
|
||
*/
|
||
@Keep
|
||
public interface IMogoHttpDns extends IProvider {
|
||
|
||
/**
|
||
* 获取缓存中的dns ip地址
|
||
*
|
||
* @param host domain
|
||
* @param type 类型
|
||
* @return
|
||
*/
|
||
@Keep
|
||
String getCachedHttpDnsIps(String host, int type);
|
||
|
||
/**
|
||
* dns解析
|
||
*
|
||
* @param host
|
||
* @param type
|
||
* @param useCache
|
||
* @param callback
|
||
*/
|
||
@Keep
|
||
void getHttpDnsIp(String host, int type, boolean useCache, IHttpDnsCallback callback);
|
||
|
||
/**
|
||
* 同步进行dns解析,无需回调
|
||
*
|
||
* @param host
|
||
* @param type
|
||
* @param useCache
|
||
* @return ip:port
|
||
*/
|
||
String syncGetHttpDns(String host, int type, boolean useCache);
|
||
|
||
/**
|
||
* 注册HttpDns地址变化监听
|
||
* @param listener {@link OnAddressChangedListener}
|
||
*/
|
||
void addressChangedListener(OnAddressChangedListener listener);
|
||
}
|