Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.22 KB

README.md

File metadata and controls

27 lines (19 loc) · 1.22 KB

goipify

GitHub go.mod Go version of a Go module Go Go Report Card Go Doc Lines of code Developed with <3

Since we liked to access ipify's API for a small project, we developed the following library.

Install

go get github.com/jjideenschmiede/goipify

How to use?

Get your IP

With this function you get your current public IP address. You get the data back in JSON format. And you can access it directly via the Struct.

// Get my ip address
ip, err := goipify.Ip()
if err != nil {
    log.Fatalln(err)
} else {
    log.Println(ip)
}