https://github.com/kimi0230/redisipcountry
Mapping IP to Country use go-redis/redis/v8
https://github.com/kimi0230/redisipcountry
docker-compose golang redis redis-client redis-go
Last synced: about 2 months ago
JSON representation
Mapping IP to Country use go-redis/redis/v8
- Host: GitHub
- URL: https://github.com/kimi0230/redisipcountry
- Owner: kimi0230
- Created: 2021-07-29T08:13:12.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-02T09:47:03.000Z (almost 5 years ago)
- Last Synced: 2025-01-16T10:55:17.271Z (over 1 year ago)
- Topics: docker-compose, golang, redis, redis-client, redis-go
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Redis IP to Country
Mapping IP to Country use [go-redis/redis/v8](https://github.com/go-redis/redis)
## GeoLite2 City
1. sign up : https://www.maxmind.com/en/home
2. guide : https://blog.csdn.net/qq_26373925/article/details/111876765
## Run
### config
Path : `config/config.go`
``` go
// config for redis
var (
// Addr = "redis-ipcountry-redis:6379" // for docker
Addr = "127.0.0.1:6379" // for localhost
Password = ""
DB = 1
)
// file path for ip to country
const FilePath = "../asset/GeoLite2-City-CSV/"
```
### start service
``` shell
docker-compose up -d
```
### shutdown
``` shell
docker-compose down
```
### Reference
* [go-redis 連接池](https://www.huaweicloud.com/articles/db24f1e8b4a4f0218ddf08463d8ec871.html)