go get github.com/jvanrhyn/brgeo
Compatibility: go >= 1.21
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.
- Ping me on mastodon @jvanrhyn (DMs, mentions, whatever :))
- Fork the project
- Fix open issues or request new features
Don't hesitate ;)
# Install some dev dependencies
make tools
# Run tests
make test
# or
make watch-test
Give a โญ๏ธ if this project helped you!
Copyright ยฉ 2023 Johan van Rhyn.
This project is MIT licensed.