package mmdb

  1. Overview
  2. Docs

Module MmdbSource

Binding to the maxminddb library which parses the MMDB format commonly known as GeoIP2

Sourcetype t

Reference to a MMBD file

Sourceexception Binding_integrity_error of string

Thrown when an error is detected that is an internal error of the library, not a usage error. It is recommended not to handle this, instead report a bug report in the library

Sourcemodule Common_error : sig ... end
Sourcemodule Open_file_error : sig ... end
Sourcemodule Lookup_ip_error : sig ... end
Sourcemodule Lookup_error : sig ... end
Sourcemodule Lookup_result : sig ... end
Sourcemodule Path : sig ... end
Sourcemodule Ip : sig ... end
Sourcemodule Coordinates : sig ... end
Sourceval open_file : Path.t -> (t, Open_file_error.t) result

Open an MMDB file and return a reference to it

Sourceval coordinates : t -> Ip.t -> Coordinates.t Lookup_result.t

Determine the coordinates of an IP

Sourceval country_code : t -> Ip.t -> string Lookup_result.t

Determine the country code of an IP

Sourceval region_code : t -> Ip.t -> string Lookup_result.t

Determine the region an IP is in

OCaml

Innovation. Community. Security.