1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-26 09:25:23 +00:00
v2fly/features/dns/client.go

31 lines
659 B
Go
Raw Normal View History

2018-10-11 20:34:31 +00:00
package dns
import (
2018-10-11 21:09:15 +00:00
"v2ray.com/core/common/net"
2018-10-11 20:34:31 +00:00
"v2ray.com/core/features"
)
// Client is a V2Ray feature for querying DNS information.
type Client interface {
features.Feature
LookupIP(host string) ([]net.IP, error)
}
2018-10-12 21:57:56 +00:00
2018-10-13 10:09:58 +00:00
// ClientType returns the type of Client interface. Can be used for implementing common.HasType.
2018-10-12 21:57:56 +00:00
func ClientType() interface{} {
return (*Client)(nil)
}
2018-10-21 08:27:13 +00:00
type LocalClient struct{}
func (LocalClient) Type() interface{} {
return ClientType()
}
func (LocalClient) Start() error { return nil }
func (LocalClient) Close() error { return nil }
func (LocalClient) LookupIP(host string) ([]net.IP, error) {
return net.LookupIP(host)
}