Files
ddns-updater/public_resolvers/ifconfigme.go

31 lines
447 B
Go
Raw Normal View History

2023-04-28 14:57:21 +02:00
package public_resolvers
import (
"net/http"
2023-04-29 12:45:21 +02:00
"time"
2023-04-28 14:57:21 +02:00
)
const (
IfConfigMeTag = "ifconfig.me"
ifConfigMeUrl = "https://ifconfig.me"
)
type IfConfigMe struct {
2023-05-01 10:01:43 +02:00
baseResolver
2023-04-28 14:57:21 +02:00
}
2023-04-29 12:45:21 +02:00
func NewDefaultIfConfigMe() *IfConfigMe {
return NewIfConfigMe(&http.Client{
Timeout: 10 * time.Second,
})
}
2023-05-01 10:01:43 +02:00
func NewIfConfigMe(client Doer) *IfConfigMe {
return &IfConfigMe{
baseResolver: baseResolver{
client: client,
url: ifConfigMeUrl,
},
2023-04-28 14:57:21 +02:00
}
}