geoip2 0.1.0.1 → 0.1.0.2
raw patch · 4 files changed
+41/−5 lines, 4 filesdep ~base
Dependency ranges changed: base
Files
- ChangeLog.md +6/−0
- Data/GeoIP2.hs +1/−1
- README.md +24/−0
- geoip2.cabal +10/−4
+ ChangeLog.md view
@@ -0,0 +1,6 @@+# 0.1.0.1 -> 0.1.0.2+ +- GHC-7.10 compatibiliy+- Add Changelog.md+- List Changelog.md and README.md in cabal's extra-source-files+- add stack.yaml
Data/GeoIP2.hs view
@@ -43,7 +43,7 @@ -- | Handle for search operations data GeoDB = GeoDB {- geoMem :: BL.ByteString+ geoMem :: BL.ByteString , geoDbType :: T.Text -- ^ String that indicates the structure of each data record associated with an IP address , geoDbLanguages :: [T.Text] -- ^ Languages supported in database , geoDbNodeCount :: Int64
+ README.md view
@@ -0,0 +1,24 @@+GeoIP2 - library for accessing GeoIP2 database+==========++GeoIP2 is a haskell binding to the MaxMind GeoIP2 database.+It parses the database according to the MaxMind DB+<a href="http://maxmind.github.io/MaxMind-DB/">specification</a>,+version 2 of the specification is supported. The free geolite2 database can+be downloaded at http://dev.maxmind.com/geoip/geoip2/geolite2/.++See haddock documentaion for details.++```Haskell+{-# LANGUAGE OverloadedStrings #-}+import Data.GeoIP2+import Data.IP (IP(..))++main = do+ geodb <- openGeoDB "GeoLite2-City.mmdb"+ let ip = IPv4 "23.253.242.70"+ print $ (findGeoData geodb "en" ip :: Maybe GeoResult)++ let ip2 = IPv6 "2001:4800:7817:104:be76:4eff:fe04:f608"+ print $ (findGeoData geodb "en" ip2 :: Maybe GeoResult)+```
geoip2.cabal view
@@ -1,5 +1,5 @@ name: geoip2-version: 0.1.0.1+version: 0.1.0.2 synopsis: Pure haskell interface to MaxMind GeoIP database description: GeoIP2 is a haskell binding to the MaxMind GeoIP2 database.@@ -14,6 +14,7 @@ category: Database build-type: Simple cabal-version: >=1.10+extra-source-files: README.md ChangeLog.md source-repository head type: git@@ -22,8 +23,13 @@ library exposed-modules: Data.GeoIP2 other-modules: Data.GeoIP2.Fields, Data.GeoIP2.SearchTree- build-depends: base >=4.7 && <4.8,- bytestring-mmap, bytestring, binary, text, containers,- iproute(>=1.4.0), reinterpret-cast+ build-depends: base >=4.7 && <4.9+ , bytestring-mmap+ , bytestring+ , binary+ , text+ , containers+ , iproute(>=1.4.0)+ , reinterpret-cast default-language: Haskell2010 ghc-options: -Wall