Change Lookup method names
The Local was redundant (and inaccurate in the case of the mDNS client implementation), and otherwise they are too nondescript.
This commit is contained in:
1 parent
5f642d390c
commit
ff45bcf945
7 files changed
+22
-22
No files matched your search
+4
-4
@@ -15,8 +15,8 @@ const (
|
||||
var rdnsDomainLen = len(RDNS_DOMAIN) + 1
|
||||
|
||||
type Lookup interface {
|
||||
LookupLocal(name string) (net.IP, error)
|
||||
ReverseLookupLocal(inaddr string) (string, error)
|
||||
LookupName(name string) (net.IP, error)
|
||||
LookupInaddr(inaddr string) (string, error)
|
||||
}
|
||||
|
||||
type Zone interface {
|
||||
@@ -61,7 +61,7 @@ func (zone *ZoneDb) indexOf(match func(Record) bool) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (zone *ZoneDb) LookupLocal(name string) (net.IP, error) {
|
||||
func (zone *ZoneDb) LookupName(name string) (net.IP, error) {
|
||||
zone.mx.RLock()
|
||||
defer zone.mx.RUnlock()
|
||||
for _, r := range zone.recs {
|
||||
@@ -72,7 +72,7 @@ func (zone *ZoneDb) LookupLocal(name string) (net.IP, error) {
|
||||
return nil, LookupError(name)
|
||||
}
|
||||
|
||||
func (zone *ZoneDb) ReverseLookupLocal(inaddr string) (string, error) {
|
||||
func (zone *ZoneDb) LookupInaddr(inaddr string) (string, error) {
|
||||
if revIP := net.ParseIP(inaddr[:len(inaddr)-rdnsDomainLen]); revIP != nil {
|
||||
revIP4 := revIP.To4()
|
||||
ip := []byte{revIP4[3], revIP4[2], revIP4[1], revIP4[0]}
|
||||
|
||||
Reference in new issue
Block a user