1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 10:08:15 -05:00
v2fly/app/dns/dns.go
Darien Raymond 0e01e9e9ca
comments
2017-04-09 14:49:40 +02:00

24 lines
455 B
Go

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