opendnsmyip: A Go package to return the public-facing IPv4 address of the client (by querying the Cisco OpenDNS servers).
Jeff Johnson a7be812151 Update dependenices | 3 years ago | |
---|---|---|
.github | 3 years ago | |
.deepsource.toml | 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 | 3 years ago | |
go.sum | 3 years 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 |
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 "go.gridfinity.dev/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,
)
}
}