# `locus_mmdb_check`
[🔗](https://github.com/g-andrade/locus/blob/2.3.15/src/locus_mmdb_check.erl#L24)

API for working with MMDB - wholesomeness check.

# `bad_chunk_in_data_section`

```erlang
-type bad_chunk_in_data_section() ::
          {bad_chunk_in_data_section,
           #{position := non_neg_integer(),
             why := term(),
             under := #{path := [{non_neg_integer(), term()}]}}}.
```

# `bad_data_index_in_tree`

```erlang
-type bad_data_index_in_tree() ::
          {bad_data_index_in_tree,
           non_neg_integer(),
           #{why := term(), under := #{prefix := string(), path := [non_neg_integer()]}}}.
```

# `bad_node_index_in_tree`

```erlang
-type bad_node_index_in_tree() ::
          {bad_node_index_in_tree,
           non_neg_integer(),
           #{under := #{prefix := string(), path := [non_neg_integer()]}}}.
```

# `error`

```erlang
-type error() ::
          bad_node_index_in_tree() |
          bad_data_index_in_tree() |
          excessively_long_path_in_tree() |
          loop_in_data_section() |
          invalid_position_in_data_section() |
          bad_chunk_in_data_section() |
          map_key_of_wrong_type_in_data_section() |
          invalid_utf8_string_in_data_section().
```

# `excessively_long_path_in_tree`

```erlang
-type excessively_long_path_in_tree() ::
          {excessively_long_path_in_tree,
           non_neg_integer(),
           #{under := #{prefix := string(), path := [non_neg_integer()]}}}.
```

# `invalid_position_in_data_section`

```erlang
-type invalid_position_in_data_section() ::
          {invalid_position_in_data_section,
           #{which => non_neg_integer(), under := #{path := [{non_neg_integer(), term()}]}}}.
```

# `invalid_utf8_string_in_data_section`

```erlang
-type invalid_utf8_string_in_data_section() ::
          {invalid_utf8_string_in_data_section,
           #{position := non_neg_integer(),
             original_data := binary(),
             error := term(),
             under := #{path := [{non_neg_integer(), term()}]}}}.
```

# `loop_in_data_section`

```erlang
-type loop_in_data_section() :: {loop_in_data_section, #{path => [{non_neg_integer(), term()}, ...]}}.
```

# `map_key_of_wrong_type_in_data_section`

```erlang
-type map_key_of_wrong_type_in_data_section() ::
          {map_key_of_wrong_type_in_data_section,
           #{position := non_neg_integer(),
             key := term(),
             under := #{path := [{non_neg_integer(), term()}]}}}.
```

# `unprintable_utf8_string_in_data_section`

```erlang
-type unprintable_utf8_string_in_data_section() ::
          {unprintable_utf8_string_in_data_section,
           #{position := non_neg_integer(),
             value := unicode:unicode_binary(),
             under := #{path := [{non_neg_integer(), term()}]}}}.
```

# `warning`

```erlang
-type warning() :: unprintable_utf8_string_in_data_section().
```

# `run`

```erlang
-spec run(locus_mmdb:database()) ->
             ok | {warnings, [warning(), ...]} | {errors, [error(), ...], [warning()]}.
```

Checks for errors and quirks within `Database`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
