This repository contains a Go implementation of the IP Intelligence engine. This module allows you to call functions for determining to set up with an IP Intelligence engine and begin using it to process IP addresses.
Module: ip-intelligence-go
at path github.com/51Degrees/ip-intelligence-go/v4
This Go version contains the following packages:
ipi_interop
- a lower level API wrapping the C IP Intelligence libraryipi_onpremise
- a higher level Engine API providing IP Intelligence library and file update functions
- Go 1.19
To process IP addresses, you will need to use the 51Degrees data file. See ip-intelligence-data repo for the instructions on how to get a Lite data file or contact us to get an Enterprise data file.
If you are on Windows, make sure that:
- The path to the
MinGW-x64
bin
folder is included in thePATH
. By default, the path should beC:\msys64\ucrt64\bin
- Go environment variable
CGO_ENABLED
is set to1
bash go env -w CGO_ENABLED=1
Import the package as usual and it will get build automatically:
go import "github.com/51Degrees/ip-intelligence-go/v4/ipi_onpremise"
Implementation wraps an amalgamated C library from ip-intelligence-cxx repo
Unit tests can be run with go test ./...
from the root dir.
To view APIs and their descriptions, users can use go doc
in the package directory.
- First navigate to
ipi_interop
oripi_onpremise
dir. - Then run the below to display all APIs, structures and their descriptions.
go doc -all
Examples are included in a separate repository at ip-intelligence-go-examples. Users can follow its README.md for details and comments in each examples for how to run them.