Skip to content

Commit

Permalink
feat: added provider filter for ip version
Browse files Browse the repository at this point in the history
Signed-off-by: Mario-F <github@fritschen.net>
  • Loading branch information
Mario-F committed Mar 8, 2022
1 parent a5d5925 commit 79f75ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/externalip/externalip.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ type ExternalIP struct {

// GetExternalIP gets the actual external IP by different Provides
func GetExternalIP(version network.IPVersion) (ExternalIP, error) {
var pList []providers.Provider = providers.ProviderList
var pList []providers.Provider

for _, p := range providers.ProviderList {
if p.Version == version {
pList = append(pList, p)
}
}
logger.Debugf("Found %d providers for ip version %s", len(pList), string(version))

result := ExternalIP{}
result.Version = version

Expand Down

0 comments on commit 79f75ec

Please sign in to comment.