v2ray-core/app/dns/dns.go

21 lines
309 B
Go
Raw Normal View History

2015-12-06 11:00:10 +01:00
package dns
import (
"net"
2015-12-10 23:55:39 +01:00
2016-08-20 20:55:45 +02:00
"v2ray.com/core/app"
2016-01-31 17:01:28 +01:00
)
2015-12-06 11:00:10 +01:00
2017-01-13 14:33:32 +01:00
// A Server is a DNS server for responding DNS queries.
2016-05-15 23:09:28 -07:00
type Server interface {
Get(domain string) []net.IP
2015-12-06 11:00:10 +01:00
}
2017-01-06 15:32:36 +01:00
func FromSpace(space app.Space) Server {
2017-01-13 13:41:40 +01:00
app := space.GetApplication((*Server)(nil))
2017-01-06 15:32:36 +01:00
if app == nil {
return nil
}
return app.(Server)
}