~trn/opendnsmyip

opendnsmyip: A Go package to return the public-facing IPv4 address of the client by querying the Cisco OpenDNS servers
3f5d8efc — Jeffrey H. Johnson 3 months ago
Update dependencies
86af7b41 — Jeffrey H. Johnson 2 years ago
Bump dependencies
6e2afc34 — Jeffrey H. Johnson 2 years ago
Bump dependencies

clone

read-only
https://git.sr.ht/~trn/opendnsmyip
read/write
git@git.sr.ht:~trn/opendnsmyip

You can also use your local clone with git send-email.

#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,
                          )
        }
}
Do not follow this link