modulepackage
2.0.0+incompatible
Repository: https://github.com/danielcherubini/geoip-api.git
Documentation: pkg.go.dev
# README
geoip-api
I convert ip's into countries and stuff
Usage
./geoip-api --lang languages.json
Lang is Required
Flags
- lang --- location of local language.json
- mmdb - location of local .mmdb file
- gzdb -- location of local .gzip file
- dburl -- location of remote file (can be mmdb or gzip)
- s3bucket -- s3 bucket
- s3key -- full filepath so if the file is at /foo/bar/qux.jpg then thats your key
- s3region -- region of the s3 bucket
Language JSON
{
"languages": [
{ "language": "en", "country": "US" },
{ "language": "en", "country": "CA" },
{ "language": "en", "country": "AU" },
{ "language": "en", "country": "GB" },
{ "language": "en", "country": "NO" },
{ "language": "es", "country": "MX" },
{ "language": "es", "country": "ES" }
],
"default": {
"language": "en",
"country": "NO"
}
}
API Usage
curl http://127.0.0.1:45000/\?ip\=193.215.2.26
Install using
curl -Ls https://raw.githubusercontent.com/danmademe/geoip-api/master/install.sh | sudo -H sh
# Functions
CheckIPRoute is the route for checking IPReturns with ip address.
Load this gets the config file from flag accepts --lang flag.
Router dfdfd.
Server setup for server.
Setup sets server up for logfatal.