Skip to content

jjideenschmiede/goipify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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