MMDB2 Decoder v0.1.0 MMDB2Decoder View Source

MMDB2 file format decoder.

Link to this section Summary

Functions

Looks up the data associated with an IP tuple

Parses a database binary and splits it into metadata, lookup tree and data

Utility method to pipe parse_database/1 directly to lookup/4

Link to this section Functions

Link to this function lookup(ip, meta, tree, data) View Source
lookup(tuple(), MMDB2Decoder.Metadata.t(), binary(), binary()) ::
  map() |
  nil

Looks up the data associated with an IP tuple.

Link to this function parse_database(contents) View Source
parse_database(binary()) ::
  {MMDB2Decoder.Metadata.t(), binary(), binary()} |
  {:error, term()}

Parses a database binary and splits it into metadata, lookup tree and data.

Link to this function pipe_lookup(arg, ip) View Source
pipe_lookup({MMDB2Decoder.Metadata.t(), binary(), binary()}, tuple()) ::
  map() |
  nil

Utility method to pipe parse_database/1 directly to lookup/4.