Skip to content

A simple microservice in Go providing the geolocation of IP addresses as a POC adaptation of my favorites principles to this language.

Notifications You must be signed in to change notification settings

renaudcalmont/geoip

Repository files navigation

geoip (Go demonstration)

A minimalistic HTTP + JSON (let insist on it: not RESTful) web service with an enterprise-grade code organisation.

The payload is borrowed from different examples, see the references below for details.

This project focuses on good practices for maintainability.

What is that actually?

What is it not?

How to try it?

See available parameters:

$ docker run --rm geoip -h

Launch and immediately destroy a container to show the quick help about CLI parameters.

Example lunch command:

$ docker run -d -u 33 -p 5002:5000 geoip

This will start a container in the background with the www-data identity on Debian-derived systems. The container will accept queries on localhost 5002/TCP port.

Example query:

$ curl -XPOST -H "Content-Type: application/json" -d '{"address":"<any>"}' http://localhost:5002/country

Replace <any> with your public IPv4 or IPv6 address or a purposely misspelled one.

About

A simple microservice in Go providing the geolocation of IP addresses as a POC adaptation of my favorites principles to this language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published