You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/app/dns/dns.go

24 lines
455 B

9 years ago
package dns
//go:generate go run $GOPATH/src/v2ray.com/core/tools/generrorgen/main.go -pkg dns -path App,DNS
9 years ago
import (
"net"
"v2ray.com/core/app"
)
9 years ago
8 years ago
// A Server is a DNS server for responding DNS queries.
type Server interface {
Get(domain string) []net.IP
9 years ago
}
8 years ago
// FromSpace fetches a DNS server from context.
func FromSpace(space app.Space) Server {
8 years ago
app := space.GetApplication((*Server)(nil))
if app == nil {
return nil
}
return app.(Server)
}