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 лет назад | |
---|---|---|
.github | 3 лет назад | |
.deepsource.toml | 3 лет назад | |
.gitignore | 7 лет назад | |
.gitlab-ci.yml | 3 лет назад | |
.mergify.yml | 3 лет назад | |
.opendnsmyip_root | 3 лет назад | |
.whitesource | 3 лет назад | |
LICENSE | 3 лет назад | |
README.md | 3 лет назад | |
SECURITY.md | 3 лет назад | |
cov_report.sh | 3 лет назад | |
go.mod | 3 лет назад | |
go.sum | 3 лет назад | |
opendnsmyip.go | 3 лет назад | |
opendnsmyip_license_test.go | 3 лет назад | |
opendnsmyip_test.go | 3 лет назад | |
opendnsmyip_testutil_test.go | 3 лет назад |
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,
)
}
}