locus_mmdb_data_codec (locus v2.3.15)

Copy Markdown View Source

API for working with MMDB - data codec.

See MaxMind DB File Format Specification.

Summary

Types

index()

-type index() :: non_neg_integer().

Functions

parse_all(FullData, Raw)

parse_on_index(Index, DataSection, Raw)

-spec parse_on_index(Index, DataSection, Raw) -> {Value | RawValue, RemainingData}
                        when
                            Index :: index(),
                            DataSection :: binary(),
                            Raw :: boolean(),
                            Value :: locus_mmdb_data:value(),
                            RawValue :: locus_mmdb_data_raw:value(),
                            RemainingData :: binary().

Attempts to parse either the Value or RawValue (depending on the Raw flag) at Index in DataSection.

Will crash upon invalid/unrecognized data, invalid pointers or cyclic pointer chasing (i.e. loops.)

validate_indices_in_tree(BitArray, VisitedBitArray, MapKeysBitArray, BatchSize, BatchOffset, Data, Journal)

-spec validate_indices_in_tree(locus_shared_bitarray:t(),
                               locus_shared_bitarray:t(),
                               locus_shared_bitarray:t(),
                               pos_integer(),
                               non_neg_integer(),
                               binary(),
                               locus_mmdb_check_journal:t()) ->
                                  ok.