brgeo: Facade for KeyCDN Geolocation
π Install
go get github.com/jvanrhyn/brgeo
Compatibility: go >= 1.21
π‘ Usage
Description
A simple facade library to wrap access to external IP Address geo-location information. Currently, it supports the following services:
KeyCDN: https://tools.keycdn.com/geo
Third party endpoint results is mapped to a well-known model, so you can easily switch between services.
type LookupResponse struct {
City string `json:"city"`
RegionName string `json:"region"`
CountryName string `json:"country"`
}
Query results are cached using the github.com/patrickmn/go-cache
library.
π€ Contributing
Don't hesitate ;)
# Install some dev dependencies
make tools
# Run tests
make test
# or
make watch-test
π€ Contributors
π« Show your support
Give a βοΈ if this project helped you!
π License
Copyright Β© 2023 Johan van Rhyn.
This project is MIT licensed.