README.md 4.5 KB

opendnsmyip

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

License GoVersion PkgGoDev GoReportCard GitHubRelease LocCount GitHubCodeSize CoverageStatus CodacyBadge CodebeatBadge CodeClimateMaintainability TickgitTODOs DeepSource DeepScanGrade FOSSA Status

Availability

Go Modules

Source Code

Issue Tracking

Security Policy

Original Authors

Coverage Reports

Credits

This package was inspired by:

License

Usage

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