client.go 775 B

1234567891011121314151617181920212223242526272829
  1. package dns
  2. import (
  3. "v2ray.com/core/common/net"
  4. "v2ray.com/core/features"
  5. )
  6. // Client is a V2Ray feature for querying DNS information.
  7. type Client interface {
  8. features.Feature
  9. // LookupIP returns IP address for the given domain. IPs may contain IPv4 and/or IPv6 addresses.
  10. LookupIP(domain string) ([]net.IP, error)
  11. }
  12. // IPv4Lookup is an optional feature for querying IPv4 addresses only.
  13. type IPv4Lookup interface {
  14. LookupIPv4(domain string) ([]net.IP, error)
  15. }
  16. // IPv6Lookup is an optional feature for querying IPv6 addresses only.
  17. type IPv6Lookup interface {
  18. LookupIPv6(domain string) ([]net.IP, error)
  19. }
  20. // ClientType returns the type of Client interface. Can be used for implementing common.HasType.
  21. func ClientType() interface{} {
  22. return (*Client)(nil)
  23. }