All Projects → zabolotnov87 → Geoip_redis

zabolotnov87 / Geoip_redis

Licence: mit
Put MaxMind GeoIP database to Redis

Programming Languages

ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Geoip redis

Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+33700%)
Mutual labels:  redis
Predixy
A high performance and fully featured proxy for redis, support redis sentinel and redis cluster
Stars: ✭ 862 (+4004.76%)
Mutual labels:  redis
Go Demo
Go语言实例教程从入门到进阶,包括基础库使用、设计模式、面试易错点、工具类、对接第三方等
Stars: ✭ 881 (+4095.24%)
Mutual labels:  redis
Cpp redis
C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform - NO LONGER MAINTAINED - Please check https://github.com/cpp-redis/cpp_redis
Stars: ✭ 855 (+3971.43%)
Mutual labels:  redis
Mysql redis replication
MySQL replication to Redis cache server via Ruby, Gearman, triggers, and MySQL UDF (Ubuntu version)
Stars: ✭ 10 (-52.38%)
Mutual labels:  redis
Tutorial Graphql Subscriptions Redis
GraphQL server implementation with Redis backing allowing pubsub
Stars: ✭ 12 (-42.86%)
Mutual labels:  redis
Springbootunity
rabbitmq、redis、scheduled、socket、mongodb、Swagger2、spring data jpa、Thymeleaf、freemarker etc. (muti module spring boot project) (with spring boot framework,different bussiness scence with different technology。)
Stars: ✭ 845 (+3923.81%)
Mutual labels:  redis
Delay Queue
延迟队列
Stars: ✭ 884 (+4109.52%)
Mutual labels:  redis
Unredis
Redis Monitoring tool written in Golang and React.js
Stars: ✭ 11 (-47.62%)
Mutual labels:  redis
Activemq
高性能消息监控无服务器,使用ActiveMQ消息中间件实现,使用MQ、redis、nlog 等技术实现
Stars: ✭ 13 (-38.1%)
Mutual labels:  redis
Redisbloom
Probabilistic Datatypes Module for Redis
Stars: ✭ 858 (+3985.71%)
Mutual labels:  redis
Netkiller.github.io
Netkiller Free ebook - 免费电子书
Stars: ✭ 861 (+4000%)
Mutual labels:  redis
Javaok
必看!java后端,亮剑诛仙。java发展路线技术要点。
Stars: ✭ 867 (+4028.57%)
Mutual labels:  redis
Predis
A flexible and feature-complete Redis client for PHP.
Stars: ✭ 6,966 (+33071.43%)
Mutual labels:  redis
Redis Ratelimit
A fixed window rate limiter based on Redis
Stars: ✭ 15 (-28.57%)
Mutual labels:  redis
Walrus
Lightweight Python utilities for working with Redis
Stars: ✭ 846 (+3928.57%)
Mutual labels:  redis
Metta
An information security preparedness tool to do adversarial simulation.
Stars: ✭ 867 (+4028.57%)
Mutual labels:  redis
Spring Security Rbac Jwt
springboot2项目的脚手架工程(包含security + jwt方式的动态权限校验)
Stars: ✭ 21 (+0%)
Mutual labels:  redis
Treefrog Framework
TreeFrog Framework : High-speed C++ MVC Framework for Web Application
Stars: ✭ 885 (+4114.29%)
Mutual labels:  redis
Ssm redis template
An template based on Maven, using Spring + Spring MVC + mybatis + spring-data-redis frames. It can be used to construct a new Java Web Appliaction quickly
Stars: ✭ 13 (-38.1%)
Mutual labels:  redis

Build Status

GeoipRedis

Puts MaxMind GeoIP2 database to Redis and allows to resolve country/city by ip. The main idea described here.

Restrictions

  • legacy version of GeoIP database isn't supported
  • working only with IPv4 database

Installation

Add this line to your application's Gemfile:

gem "geoip_redis"

And then execute:

$ bundle

Or install it yourself as:

$ gem install redis_geoip

Usage

Working with GeoIP2 Country database:

  • load:
require "redis"
require "geoip_redis/country_loader"

redis = Redis.new(url: "redis://localhost:6379/4")
loader = GeoipRedis::CountryLoader.new(redis)

loader.load_blocks("path/to/blocks_ipv4.csv")
loader.load_locations("path/to/locations.csv")
  • resolve country by ip:
require "redis"
require "geoip_redis/resolver"

redis = Redis.new(url: "redis://localhost:6379/4")
resolver = GeoipRedis::Resolver.new(redis)

country = resolver.resolve("123.234.23.12")

Working with GeoIP2 City database:

  • load:
require "redis"
require "geoip_redis/city_loader"

redis = Redis.new(url: "redis://localhost:6379/5")
loader = GeoipRedis::CityLoader.new(redis)

loader.load_blocks("path/to/blocks_ipv4.csv")
loader.load_locations("path/to/locations.csv")
  • resolve city by ip:
require "redis"
require "geoip_redis/resolver"

redis = Redis.new(url: "redis://localhost:6379/5")
resolver = GeoipRedis::Resolver.new(redis)

city = resolver.resolve("123.234.23.12")

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/zabolotnov87/geoip_redis. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Licence

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].