opendnsmyip: A Go package to return the public-facing IPv4 address of the client (by querying the Cisco OpenDNS servers).

Jeffrey H. Johnson 128846b1e9 Update dependencies 1 day ago
.github 8ed14cab3c Merge pull request #36 from gridfinity/remove>shiftleft 6 months ago
.deepsource.toml 61b5949480 Update .deepsource.toml 2 months ago
.gitattributes ab96342e33 Add .gitattributes: GitHub linguist vendoring 2 months ago
.gitignore 76715630b9 Initial commit. 4 years ago
.gitlab-ci.yml 419f30d46f Bump deps, update leaktestfe, revise CI/CD config 4 months ago
.mergify.yml ab66da024b Mergify: configuration update 6 months ago
.opendnsmyip_root b583964457 multi: CI/CD integration, code coverage reporting 6 months ago
.whitesource d8be057a52 Update .whitesource 6 months ago
LICENSE 7ceb7be0f7 multi: use github for imports, etc. 3 months ago
README.md 399d713382 Update README.md 2 months ago
SECURITY.md 7ceb7be0f7 multi: use github for imports, etc. 3 months ago
cov_report.sh 61c5509778 cov: Warn cov_report.sh is not POSIX compliant 6 months ago
go.mod 128846b1e9 Update dependencies 1 day ago
go.sum 128846b1e9 Update dependencies 1 day ago
opendnsmyip.go fdcddf8455 Update dependencies, import paths, tag format, etc 3 months ago
opendnsmyip_license_test.go 7ceb7be0f7 multi: use github for imports, etc. 3 months ago
opendnsmyip_test.go fdcddf8455 Update dependencies, import paths, tag format, etc 3 months ago
opendnsmyip_testutil_test.go 7ceb7be0f7 multi: use github for imports, etc. 3 months ago

README.md

opendnsmyip

GRC

A Go package that returns the public-facing IPv4 address of the client by querying the Cisco OpenDNS servers.

Original Authors

Credits

This package was inspired by:

License

Usage

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,
                          )
        }
}