Remove ip/lookup.go as those are not used anymore.
This commit is contained in:
parent
a6c98a3209
commit
4d1103e133
1 changed files with 0 additions and 23 deletions
23
ip/lookup.go
23
ip/lookup.go
|
|
@ -1,23 +0,0 @@
|
||||||
package ip
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"dnsupdater/ip/resolver"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Resolver is a function that gets the ip from a interface name
|
|
||||||
type NetInterfaceIPResolver func(iface string) (net.IP, error)
|
|
||||||
|
|
||||||
func LookupWrapper(service resolver.Service) NetInterfaceIPResolver {
|
|
||||||
return func(iface_name string) (net.IP, error) {
|
|
||||||
if iface_name == resolver.WAN_IFACE {
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
|
||||||
defer cancel()
|
|
||||||
return service.Lookup(ctx)
|
|
||||||
}
|
|
||||||
return GetInterfaceIP(iface_name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue