v2ray-core/app/dns/dns.go

23 lines
407 B
Go
Raw Normal View History

2015-12-06 10:00:10 +00:00
package dns
2017-04-08 23:43:25 +00:00
//go:generate go run $GOPATH/src/v2ray.com/core/tools/generrorgen/main.go -pkg dns -path App,DNS
2015-12-06 10:00:10 +00:00
import (
"net"
2015-12-10 22:55:39 +00:00
2016-08-20 18:55:45 +00:00
"v2ray.com/core/app"
2016-01-31 16:01:28 +00:00
)
2015-12-06 10:00:10 +00:00
2017-01-13 13:33:32 +00:00
// A Server is a DNS server for responding DNS queries.
2016-05-16 06:09:28 +00:00
type Server interface {
Get(domain string) []net.IP
2015-12-06 10:00:10 +00:00
}
2017-01-06 14:32:36 +00:00
func FromSpace(space app.Space) Server {
2017-01-13 12:41:40 +00:00
app := space.GetApplication((*Server)(nil))
2017-01-06 14:32:36 +00:00
if app == nil {
return nil
}
return app.(Server)
}