-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings to the MaxMind GeoIPCity database via the C library -- -- This library provides fast, idiomatic Haskell bindings to MaxMind's -- GeoIPCity IP-based geolocation C API. -- -- Make sure you have the MaxMind C API installed before installing this -- library, as it depends on the C API. -- -- MaxMind GeoIP City database allows geo-location lookups from IP -- addresses. -- -- To get started, you can download the latest binary database -- distribution from: http://www.maxmind.com/app/geolitecity @package hs-GeoIP @version 0.3 module Data.Geolocation.GeoIP -- | Type representing an established connection to a GeoIPCity database data GeoDB data GeoIPOption -- | Collapse & combine multiple GeoIPOptions into one combineOptions :: [GeoIPOption] -> GeoIPOption standard :: GeoIPOption memory_cache :: GeoIPOption check_cache :: GeoIPOption index_cache :: GeoIPOption mmap_cache :: GeoIPOption -- | Return data for a geolocation lookup data GeoIPRecord GeoIPRecord :: !ByteString -> !ByteString -> !ByteString -> !ByteString -> !ByteString -> !ByteString -> !Double -> !Double -> !Int -> !ByteString -> !Int -> GeoIPRecord geoCountryCode :: GeoIPRecord -> !ByteString geoCountryCode3 :: GeoIPRecord -> !ByteString geoCountryName :: GeoIPRecord -> !ByteString geoRegion :: GeoIPRecord -> !ByteString geoCity :: GeoIPRecord -> !ByteString geoPostalCode :: GeoIPRecord -> !ByteString geoLatitude :: GeoIPRecord -> !Double geoLongitude :: GeoIPRecord -> !Double geoAreaCode :: GeoIPRecord -> !Int geoContinentCode :: GeoIPRecord -> !ByteString geoAccuracyRadius :: GeoIPRecord -> !Int -- | Open the binary GeoIP data file with the given options. -- -- This would open a file and cache in memory: -- --
-- openGeoDB "GeoCity.dat" memory_cache ---- -- The memory on the C side is automatically freed by the Haskell GC when -- appropriate. openGeoDB :: GeoIPOption -> String -> IO GeoDB -- | Geo-locate by given IP Adress -- --
-- geoLocateByIPAddress db "123.123.123.123" --geoLocateByIPAddress :: GeoDB -> ByteString -> IO (Maybe GeoIPRecord) -- | Geo-locate by given IP number. Call mkIpNum on a String -- ip address to convert to IP number. -- --
-- geoLocateByIPNum db 12336939327338 --geoLocateByIPNum :: GeoDB -> Integer -> IO (Maybe GeoIPRecord) geoStringByIPAddress :: GeoDB -> ByteString -> IO (Maybe ByteString) geoStringByIPNum :: GeoDB -> Integer -> IO (Maybe ByteString) -- | Convert a string IP adress to IPNum mkIpNum :: ByteString -> Maybe Integer instance Eq GeoIPRecord instance Show GeoIPRecord instance NFData GeoIPRecord