chore(publicip): refactoring

- Exported `Fetcher` interface
- Inject `Fetcher` to publicip loop and updaters
- Get public IP and information at the same time
- Only query ipinfo.io
- Make `MultiInfo` part of the `Fetch` object
This commit is contained in:
Quentin McGaw
2022-06-12 00:09:01 +00:00
parent 45c9e780c0
commit 83b4a3fe55
19 changed files with 101 additions and 155 deletions

View File

@@ -6,6 +6,7 @@ import (
"net"
"github.com/qdm12/gluetun/internal/models"
publicipmodels "github.com/qdm12/gluetun/internal/publicip/models"
"github.com/qdm12/gluetun/internal/updater/resolver"
)
@@ -28,3 +29,7 @@ type Unzipper interface {
type Warner interface {
Warn(s string)
}
type IPFetcher interface {
FetchMultiInfo(ctx context.Context, ips []net.IP) (data []publicipmodels.IPInfoData, err error)
}