You've already forked ddns-updater
Added icanhazip resolver
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
31
public_resolvers/icanhazip.go
Normal file
31
public_resolvers/icanhazip.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package public_resolvers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
IcanhazipTag = "icanhazip"
|
||||
IcanhazipUrl = "https://v4.icanhazip.com/"
|
||||
)
|
||||
|
||||
type Icanhazip struct {
|
||||
baseResolver
|
||||
}
|
||||
|
||||
func NewIcanhazipDefault() *Icanhazip {
|
||||
return NewIcanhazip(&http.Client{
|
||||
Timeout: 10 * time.Second,
|
||||
})
|
||||
}
|
||||
|
||||
func NewIcanhazip(client Doer) *Icanhazip {
|
||||
return &Icanhazip{
|
||||
baseResolver: baseResolver{
|
||||
client: client,
|
||||
url: v4IdentMeUrl,
|
||||
ipParser: defaultIpParser,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user