Golang client for Clearip web-service API to determine location of visitors based on their IP.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fixtures
.gitignore
.travis.yml
client.go
http_client.go
http_client_test.go
http_error.go
ipinfo.go
ipinfo_api.go
ipinfo_api_test.go
readme.md

readme.md

clearip.io Golang client

Golang client for Clearip web-service API to determine location of visitors based on their IP.

Installation

go get -u github.com/clearip/clearip-go

usage

Get ip info:

package main

import (
	clearip "github.com/clearip/clearip-go"
	"fmt"
)

func main() {

	clearipClient, err := clearip.NewClient("API Key HERE")
	if err != nil {
		fmt.Println(err)
		return
	}

	response, err := clearipClient.IPRepo.GetAllDataByIP("IP HERE")
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(response)
}


Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT