package maxminddb
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=784736107f675f8c20ab9aa0af13445d01483610d5b36df36c51f75c0fe101ac
md5=04c05c3c324dc80f7cae0e6879d5a67c
doc/maxminddb/Maxminddb/index.html
Module Maxminddb
Maxmind is a binding to libmaxminddb with some higher level functionality on the OCaml side. Be aware that operations with the C side are liable to raise exceptions
Type representing physical location data
type borders = {
postal_code : string;
city_name : string;
country_name : string;
continent_name : string;
iso_code : string;
}
Type representing political borders of an IP address
Languages that Maxmindb DB knows for paths ending in string queries, note that not all queries support all languages
Result of a query, mostly relevant if you are doing it by hand with calls to lookup_path
val create : path:string -> mmdb
Create a handle on a mmdb descriptor based off a .mmdb database file. Maxminddb comes with City, Country databases in etc
val dump : ?ip:string -> mmdb -> string
Dumps the database as a string; if ip is provided then dumps the database for this particular ip address, if no ip provided then dumps Metainformation about the database itself. Note that you should do not depend on this structure: it is not JSON, just looks like it.
For a given ip address, think 127.0.0.1, query path and mmdb handle, get the result. Note path must be safe, look at dump first
val postal_code : ip:string -> mmdb -> string
Short cut function for getting postal code from ip address
Short cut function for getting a city name from ip address
Short cut function for getting a country name from ip address
Short cut function for getting a continent name from ip address
Short cut function for getting a record of physical location information
val iso_code : ip:string -> mmdb -> string
ISO code for Country of ip address