package mmdb

  1. Overview
  2. Docs

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

type t

Reference to a MMBD file

exception 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

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

Open an MMDB file and return a reference to it

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

Determine the coordinates of an IP

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

Determine the country code of an IP

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

Determine the region an IP is in

OCaml

Innovation. Community. Security.