Files
ddns-updater/internal/public_resolvers/ifconfigme.go

32 lines
481 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{
2023-05-03 23:06:57 +02:00
client: client,
url: ifConfigMeUrl,
ipParser: defaultIpParser,
2023-05-01 10:01:43 +02:00
},
2023-04-28 14:57:21 +02:00
}
}