ip2region 的 Clojure 封装。
- 内置数据库文件
- 仅保留线程安全的内存查询算法
在 project.clj
中引入最新版本的依赖:
[clj-ip2region "x.y.z"]
(require '[clj-ip2region.ip2region :as ip2region])
; => nil
(ip2region/ip->region "119.29.29.29")
; => {:country "中国", :province "北京", :city "北京市", :isp "腾讯"}
(ip2region/ip->region "8.8.8.8")
; => {:country "美国", :province "0", :city "0", :isp "Level3"}
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.