opendnsmyip: A Go package to return the public-facing IPv4 address of the client (by querying the Cisco OpenDNS servers).
Jeffrey H. Johnson e0ea48a58a Merge pull request #21 from johnsonjh/dependabot/go_modules/github.com/miekg/dns-1.1.62 | 2 months ago | |
---|---|---|
.github | 3 years ago | |
.deepsource.toml | 3 years ago | |
.gitattributes | 3 years ago | |
.gitignore | 7 years ago | |
.gitlab-ci.yml | 3 years ago | |
.mergify.yml | 3 years ago | |
.opendnsmyip_root | 3 years ago | |
.whitesource | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
SECURITY.md | 3 years ago | |
cov_report.sh | 3 years ago | |
go.mod | 2 months ago | |
go.sum | 2 months ago | |
opendnsmyip.go | 3 years ago | |
opendnsmyip_license_test.go | 3 years ago | |
opendnsmyip_test.go | 3 years ago | |
opendnsmyip_testutil_test.go | 3 years ago | |
renovate.json | 1 year ago |
A Go package that returns the public-facing IPv4 address of the client by querying the Cisco OpenDNS servers.
This package was inspired by:
package main
import (
"fmt"
myip "github.com/johnsonjh/opendnsmyip"
)
func main() {
myIpAddr, err := myip.GetIP()
if err != nil {
fmt.Errorf(
"Error getting IPv4 address: %v",
err,
)
} else {
fmt.Printf(
"Public IPv4 address is: %s",
myIpAddr,
)
}
}