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

Jeffrey H. Johnson a252672351 Merge pull request #19 from johnsonjh/dependabot/go_modules/golang.org/x/net-0.23.0 преди 1 месец
.github 8ed14cab3c Merge pull request #36 from gridfinity/remove>shiftleft преди 3 години
.deepsource.toml 61b5949480 Update .deepsource.toml преди 3 години
.gitattributes ab96342e33 Add .gitattributes: GitHub linguist vendoring преди 3 години
.gitignore 76715630b9 Initial commit. преди 7 години
.gitlab-ci.yml 419f30d46f Bump deps, update leaktestfe, revise CI/CD config преди 3 години
.mergify.yml ab66da024b Mergify: configuration update преди 3 години
.opendnsmyip_root b583964457 multi: CI/CD integration, code coverage reporting преди 3 години
.whitesource d8be057a52 Update .whitesource преди 3 години
LICENSE 7ceb7be0f7 multi: use github for imports, etc. преди 3 години
README.md 399d713382 Update README.md преди 3 години
SECURITY.md 7ceb7be0f7 multi: use github for imports, etc. преди 3 години
cov_report.sh 61c5509778 cov: Warn cov_report.sh is not POSIX compliant преди 3 години
go.mod 864ebe3c38 Bump golang.org/x/net from 0.22.0 to 0.23.0 преди 1 месец
go.sum 864ebe3c38 Bump golang.org/x/net from 0.22.0 to 0.23.0 преди 1 месец
opendnsmyip.go fdcddf8455 Update dependencies, import paths, tag format, etc преди 3 години
opendnsmyip_license_test.go 7ceb7be0f7 multi: use github for imports, etc. преди 3 години
opendnsmyip_test.go fdcddf8455 Update dependencies, import paths, tag format, etc преди 3 години
opendnsmyip_testutil_test.go 7ceb7be0f7 multi: use github for imports, etc. преди 3 години
renovate.json 08b4d4fcef Add renovate.json преди 1 година

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