go-lambda-geoip

command module
v0.0.0-...-4b34b83 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2023 License: MIT Imports: 0 Imported by: 0

README

Repo for easy creating geoip API based on AWS lambda and Maxmind's GeoLite2 database.

Inspired by tmaiaroto/go-lambda-geoip.

Prerequisites

Instructions

Deploy with Docker

Build image

docker build . -t izikaj/geoip --build-arg MAXMIND_LICENSE_KEY=$MAXMIND_LICENSE_KEY

Deploy it to AWS

docker run -e AWS_ACCESS_KEY_ID="XXXXXXXXX" -e AWS_SECRET_ACCESS_KEY="YYYYYYYYYYYYY" -it izikaj/geoip

To run shell on image:

docker run -e AWS_ACCESS_KEY_ID="XXXXXXXXX" -e AWS_SECRET_ACCESS_KEY="YYYYYYYYYYYYY" -it izikaj/geoip sh

go language

Download binary

Install Guide

go-bindata

go install github.com/jteeuwen/go-bindata/go-bindata

if all set

Assuming you have AWS credentials configured and you've got the serverless and go-bindata ready to use.

You can run the following to retrieve the geoip data set, build, and deploy:

Download fresh Maxmind's database:

make download

To receive access to download the GeoLite2 databases, it now requires registration and license key usage.

Deploy stack:

make deploy

It should build and deploy the Lambda. It may take a little bit due to the size of the database file.

Features:

TODO:

  • write tests
  • return errors more detailed errors
  • refactor code
arch -x86_64 zsh

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL