maxmind 2.10.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/.github/main.workflow +16 -0
  2. package/LICENSE +1 -1
  3. package/README.md +45 -2
  4. package/examples/README.md +2 -0
  5. package/index.d.ts +118 -114
  6. package/lib/bigint.js +2 -2
  7. package/lib/metadata.js +1 -1
  8. package/package.json +6 -5
  9. package/tslint.json +4 -0
  10. package/.nyc_output/b65d0aee5ae72eefe674695f0b3cc653.json +0 -1
  11. package/.nyc_output/c194a11003d542e533dda0e03e1c0249.json +0 -1
  12. package/.nyc_output/e5178fde26f4197a251893de3577725e.json +0 -1
  13. package/scripts/lint +0 -20
  14. package/scripts/release +0 -17
  15. package/scripts/test +0 -24
  16. package/test/data/.git +0 -1
  17. package/test/data/.gitattributes +0 -1
  18. package/test/data/.gitconfig +0 -2
  19. package/test/data/.perltidyallrc +0 -11
  20. package/test/data/.tidyallrc +0 -7
  21. package/test/data/LICENSE +0 -4
  22. package/test/data/MaxMind-DB-spec.md +0 -558
  23. package/test/data/README.md +0 -4
  24. package/test/data/perltidyrc +0 -12
  25. package/test/data/source-data/GeoIP2-Anonymous-IP-Test.json +0 -32
  26. package/test/data/source-data/GeoIP2-City-Test.json +0 -12376
  27. package/test/data/source-data/GeoIP2-Connection-Type-Test.json +0 -102
  28. package/test/data/source-data/GeoIP2-Country-Test.json +0 -10975
  29. package/test/data/source-data/GeoIP2-Domain-Test.json +0 -452
  30. package/test/data/source-data/GeoIP2-Enterprise-Test.json +0 -96
  31. package/test/data/source-data/GeoIP2-ISP-Test.json +0 -12585
  32. package/test/data/source-data/GeoIP2-Precision-City-Test.json +0 -12456
  33. package/test/data/source-data/GeoIP2-Precision-ISP-Test.json +0 -12593
  34. package/test/data/source-data/README +0 -13
  35. package/test/data/test-data/GeoIP2-Anonymous-IP-Test.mmdb +0 -0
  36. package/test/data/test-data/GeoIP2-City-Test-Broken-Double-Format.mmdb +0 -0
  37. package/test/data/test-data/GeoIP2-City-Test.mmdb +0 -0
  38. package/test/data/test-data/GeoIP2-Connection-Type-Test.mmdb +0 -0
  39. package/test/data/test-data/GeoIP2-Country-Test.mmdb +0 -0
  40. package/test/data/test-data/GeoIP2-Domain-Test.mmdb +0 -0
  41. package/test/data/test-data/GeoIP2-Enterprise-Test.mmdb +0 -0
  42. package/test/data/test-data/GeoIP2-ISP-Test.mmdb +0 -0
  43. package/test/data/test-data/GeoIP2-Precision-City-Test.mmdb +0 -0
  44. package/test/data/test-data/GeoIP2-Precision-ISP-Test.mmdb +0 -0
  45. package/test/data/test-data/MaxMind-DB-no-ipv4-search-tree.mmdb +0 -0
  46. package/test/data/test-data/MaxMind-DB-string-value-entries.mmdb +0 -0
  47. package/test/data/test-data/MaxMind-DB-test-broken-pointers-24.mmdb +0 -0
  48. package/test/data/test-data/MaxMind-DB-test-broken-search-tree-24.mmdb +0 -0
  49. package/test/data/test-data/MaxMind-DB-test-decoder.mmdb +0 -0
  50. package/test/data/test-data/MaxMind-DB-test-ipv4-24.mmdb +0 -0
  51. package/test/data/test-data/MaxMind-DB-test-ipv4-28.mmdb +0 -0
  52. package/test/data/test-data/MaxMind-DB-test-ipv4-32.mmdb +0 -0
  53. package/test/data/test-data/MaxMind-DB-test-ipv6-24.mmdb +0 -0
  54. package/test/data/test-data/MaxMind-DB-test-ipv6-28.mmdb +0 -0
  55. package/test/data/test-data/MaxMind-DB-test-ipv6-32.mmdb +0 -0
  56. package/test/data/test-data/MaxMind-DB-test-metadata-pointers.mmdb +0 -0
  57. package/test/data/test-data/MaxMind-DB-test-mixed-24.mmdb +0 -0
  58. package/test/data/test-data/MaxMind-DB-test-mixed-28.mmdb +0 -0
  59. package/test/data/test-data/MaxMind-DB-test-mixed-32.mmdb +0 -0
  60. package/test/data/test-data/MaxMind-DB-test-nested.mmdb +0 -0
  61. package/test/data/test-data/README.md +0 -26
  62. package/test/data/test-data/maps-with-pointers.raw +0 -0
  63. package/test/data/test-data/write-test-data.pl +0 -561
  64. package/test/data/tidyall.ini +0 -5
  65. package/test/databases/GeoIP2-City-Test.mmdb.gz +0 -0
  66. package/test/databases/broken.dat +0 -0
  67. package/test/databases/legacy.dat +0 -0
  68. package/test/decoder.js +0 -78
  69. package/test/e2e.js +0 -146
  70. package/test/index.js +0 -176
  71. package/test/ip.js +0 -89
  72. package/test/is-gzip.js +0 -21
  73. package/test/reader.js +0 -124
@@ -1,13 +0,0 @@
1
- All of these but the City and Enterprise files are JSON dumps of the databases
2
- created by the GeoIP2 build integration tests
3
- (TestFor::MM::Integration::GeoIP2::Build).
4
-
5
- Additional data was added to match our legacy test databases.
6
-
7
- The City file is of unknown origin.
8
-
9
- The Enterprise file is a single example IP address, modified slightly to
10
- include all fields.
11
-
12
- The Precision files is the normal GeoIP2 files with an additional marker
13
- (128.101.101.101) to differentiate the two.
@@ -1,26 +0,0 @@
1
- The write-test-dbs script will create a small set of test databases with a
2
- variety of data and record sizes (24, 28, & 32 bit).
3
-
4
- These test databases are useful for testing code that reads MaxMind DB files.
5
-
6
- There is also a `maps-with-pointers.raw` file. This contains the raw output of
7
- the MaxMind::DB::Writer::Serializer module, when given a series of maps which
8
- share some keys and values. It is used to test that decoder code can handle
9
- pointers to map keys and values, as well as to the whole map.
10
-
11
- There are several ways to figure out what IP addresses are actually in the
12
- test databases. You can take a look at the
13
- [souce-data directory](https://github.com/maxmind/MaxMind-DB/tree/master/source-data)
14
- in this repository. This directory contains JSON files which are used to
15
- generate many (but not all) of the database files.
16
-
17
- You can also use the
18
- [mmdb-dump-database script](https://github.com/maxmind/MaxMind-DB-Reader-perl/blob/master/eg/mmdb-dump-database)
19
- in the
20
- [MaxMind-DB-Reader-perl repository](https://github.com/maxmind/MaxMind-DB-Reader-perl).
21
-
22
- Some databases are intentionally broken and cannot be dumped. You can look at
23
- the
24
- [script which generates these databases](https://github.com/maxmind/MaxMind-DB/blob/master/test-data/write-test-data.pl)
25
- to see what IP addresses they include, which will be necessary for those
26
- databases which cannot be dumped because they contain intentional errors.
@@ -1,561 +0,0 @@
1
- #!/usr/bin/env perl
2
-
3
- use strict;
4
- use warnings;
5
- use autodie;
6
- use utf8;
7
-
8
- use Carp qw( croak );
9
- use Cwd qw( abs_path );
10
- use File::Basename qw( dirname );
11
- use File::Slurp qw( read_file write_file );
12
- use JSON::XS qw( decode_json );
13
- use Math::Int128 qw( uint128 );
14
- use MaxMind::DB::Writer::Serializer 0.100004;
15
- use MaxMind::DB::Writer::Tree 0.100004;
16
- use MaxMind::DB::Writer::Util qw( key_for_data );
17
- use Net::Works::Network;
18
- use Test::MaxMind::DB::Common::Util qw( standard_test_metadata );
19
-
20
- my $Dir = dirname( abs_path($0) );
21
-
22
- sub main {
23
- my @sizes = ( 24, 28, 32 );
24
- my @ipv4_range = ( '1.1.1.1', '1.1.1.32' );
25
-
26
- my @ipv4_subnets = Net::Works::Network->range_as_subnets(@ipv4_range);
27
- for my $record_size (@sizes) {
28
- write_test_db(
29
- $record_size,
30
- \@ipv4_subnets,
31
- { ip_version => 4 },
32
- 'ipv4',
33
- );
34
- }
35
-
36
- write_broken_pointers_test_db(
37
- 24,
38
- \@ipv4_subnets,
39
- { ip_version => 4 },
40
- 'broken-pointers',
41
- );
42
-
43
- write_broken_search_tree_db(
44
- 24,
45
- \@ipv4_subnets,
46
- { ip_version => 4 },
47
- 'broken-search-tree',
48
- );
49
-
50
- my @ipv6_subnets = Net::Works::Network->range_as_subnets(
51
- '::1:ffff:ffff',
52
- '::2:0000:0059'
53
- );
54
-
55
- for my $record_size (@sizes) {
56
- write_test_db(
57
- $record_size,
58
- \@ipv6_subnets,
59
- { ip_version => 6 },
60
- 'ipv6',
61
- );
62
-
63
- write_test_db(
64
- $record_size,
65
- [
66
- @ipv6_subnets,
67
- Net::Works::Network->range_as_subnets( @ipv4_range, 6 ),
68
- ],
69
- { ip_version => 6 },
70
- 'mixed',
71
- );
72
- }
73
-
74
- write_decoder_test_db();
75
- write_deeply_nested_structures_db();
76
-
77
- write_geoip2_dbs();
78
- write_broken_geoip2_city_db();
79
-
80
- write_no_ipv4_tree_db();
81
-
82
- write_no_map_db( \@ipv4_subnets );
83
-
84
- write_test_serialization_data();
85
-
86
- write_db_with_metadata_pointers();
87
- }
88
-
89
- sub write_broken_pointers_test_db {
90
- no warnings 'redefine';
91
-
92
- my $orig_store_data = MaxMind::DB::Writer::Serializer->can('store_data');
93
-
94
- # This breaks the value of the record for the 1.1.1.32 network, causing it
95
- # to point outside the database.
96
- local *MaxMind::DB::Writer::Serializer::store_data = sub {
97
- my $data_pointer = shift->$orig_store_data(@_);
98
- my $value = $_[1];
99
- if ( ref($value) eq 'HASH'
100
- && exists $value->{ip}
101
- && $value->{ip} eq '1.1.1.32' ) {
102
-
103
- $data_pointer += 100_000;
104
- }
105
- return $data_pointer;
106
- };
107
-
108
- # The next hack will poison the data section for the 1.1.16/28 subnet
109
- # value. It's value will be a pointer that resolves to an offset outside
110
- # the database.
111
-
112
- my $key_to_poison = key_for_data( { ip => '1.1.1.16' } );
113
-
114
- my $orig_position_for_data
115
- = MaxMind::DB::Writer::Serializer->can('_position_for_data');
116
- local *MaxMind::DB::Writer::Serializer::_position_for_data = sub {
117
- my $key = $_[1];
118
-
119
- if ( $key eq $key_to_poison ) {
120
- return 1_000_000;
121
- }
122
- else {
123
- return shift->$orig_position_for_data(@_);
124
- }
125
- };
126
-
127
- write_test_db(@_);
128
-
129
- return;
130
- }
131
-
132
- sub write_broken_search_tree_db {
133
- my $filename = ( write_test_db(@_) )[1];
134
-
135
- my $content = read_file( $filename, { binmode => ':raw' } );
136
-
137
- # This causes the right record of the first node to be 0, meaning it
138
- # points back to the top of the tree. This should never happen in a
139
- # database that follows the spec.
140
- substr( $content, 5, 1 ) = "\0";
141
- write_file( $filename, $content, { binmode => ':raw' } );
142
-
143
- return;
144
- }
145
-
146
- sub write_test_db {
147
- my $record_size = shift;
148
- my $subnets = shift;
149
- my $metadata = shift;
150
- my $ip_version_name = shift;
151
-
152
- my $writer = MaxMind::DB::Writer::Tree->new(
153
- ip_version => $subnets->[0]->version(),
154
- record_size => $record_size,
155
- alias_ipv6_to_ipv4 => ( $subnets->[0]->version() == 6 ? 1 : 0 ),
156
- map_key_type_callback => sub { 'utf8_string' },
157
- standard_test_metadata(),
158
- %{$metadata},
159
- );
160
-
161
- for my $subnet ( @{$subnets} ) {
162
- $writer->insert_network(
163
- $subnet,
164
- { ip => $subnet->first()->as_string() }
165
- );
166
- }
167
-
168
- my $filename = sprintf(
169
- "$Dir/MaxMind-DB-test-%s-%i.mmdb",
170
- $ip_version_name,
171
- $record_size,
172
- );
173
- open my $fh, '>', $filename;
174
-
175
- $writer->write_tree($fh);
176
-
177
- close $fh;
178
-
179
- return ( $writer, $filename );
180
- }
181
-
182
- {
183
- # We will store this once for each subnet so we will also be testing
184
- # pointers, since the serializer will generate a pointer to this
185
- # structure.
186
- my %all_types = (
187
- utf8_string => 'unicode! ☯ - ♫',
188
- double => 42.123456,
189
- bytes => pack( 'N', 42 ),
190
- uint16 => 100,
191
- uint32 => 2**28,
192
- int32 => -1 * ( 2**28 ),
193
- uint64 => uint128(1) << 60,
194
- uint128 => uint128(1) << 120,
195
- array => [ 1, 2, 3, ],
196
- map => {
197
- mapX => {
198
- utf8_stringX => 'hello',
199
- arrayX => [ 7, 8, 9 ],
200
- },
201
- },
202
- boolean => 1,
203
- float => 1.1,
204
- );
205
-
206
- my %all_types_0 = (
207
- utf8_string => q{},
208
- double => 0,
209
- bytes => q{},
210
- uint16 => 0,
211
- uint32 => 0,
212
- int32 => 0,
213
- uint64 => uint128(0),
214
- uint128 => uint128(0),
215
- array => [],
216
- map => {},
217
- boolean => 0,
218
- float => 0,
219
- );
220
-
221
- sub write_decoder_test_db {
222
- my $writer = MaxMind::DB::Writer::Tree->new(
223
- ip_version => 6,
224
- record_size => 24,
225
- database_type => 'MaxMind DB Decoder Test',
226
- languages => ['en'],
227
- description => {
228
- en =>
229
- 'MaxMind DB Decoder Test database - contains every MaxMind DB data type',
230
- },
231
- alias_ipv6_to_ipv4 => 1,
232
- map_key_type_callback => sub {
233
- my $key = $_[0];
234
- $key =~ s/X$//;
235
- return $key eq 'array' ? [ 'array', 'uint32' ] : $key;
236
- }
237
- );
238
-
239
- my @subnets
240
- = map { Net::Works::Network->new_from_string( string => $_ ) }
241
- qw(
242
- ::1.1.1.0/120
243
- ::2.2.0.0/112
244
- ::3.0.0.0/104
245
- ::4.5.6.7/128
246
- abcd::/64
247
- 1000::1234:0000/112
248
- );
249
-
250
- for my $subnet (@subnets) {
251
- $writer->insert_network(
252
- $subnet,
253
- \%all_types,
254
- );
255
- }
256
-
257
- $writer->insert_network(
258
- Net::Works::Network->new_from_string( string => '::0.0.0.0/128' ),
259
- \%all_types_0,
260
- );
261
-
262
- open my $fh, '>', "$Dir/MaxMind-DB-test-decoder.mmdb";
263
- $writer->write_tree($fh);
264
- close $fh;
265
-
266
- return;
267
- }
268
- }
269
-
270
- {
271
- my %nested = (
272
- map1 => {
273
- map2 => {
274
- array => [
275
- {
276
- map3 => { a => 1, b => 2, c => 3 },
277
- },
278
- ],
279
- },
280
- },
281
- );
282
-
283
- sub write_deeply_nested_structures_db {
284
- my $writer = MaxMind::DB::Writer::Tree->new(
285
- ip_version => 6,
286
- record_size => 24,
287
- ip_version => 6,
288
- database_type => 'MaxMind DB Nested Data Structures',
289
- languages => ['en'],
290
- description => {
291
- en =>
292
- 'MaxMind DB Nested Data Structures Test database - contains deeply nested map/array structures',
293
- },
294
- alias_ipv6_to_ipv4 => 1,
295
- map_key_type_callback => sub {
296
- my $key = shift;
297
- return
298
- $key =~ /^map/ ? 'map'
299
- : $key eq 'array' ? [ 'array', 'map' ]
300
- : 'uint32';
301
- }
302
- );
303
-
304
- my @subnets
305
- = map { Net::Works::Network->new_from_string( string => $_ ) }
306
- qw(
307
- ::1.1.1.0/120
308
- ::2.2.0.0/112
309
- ::3.0.0.0/104
310
- ::4.5.6.7/128
311
- abcd::/64
312
- 1000::1234:0000/112
313
- );
314
-
315
- for my $subnet (@subnets) {
316
- $writer->insert_network(
317
- $subnet,
318
- \%nested,
319
- );
320
- }
321
-
322
- open my $fh, '>', "$Dir/MaxMind-DB-test-nested.mmdb";
323
- $writer->write_tree($fh);
324
- close $fh;
325
-
326
- return;
327
- }
328
- }
329
-
330
- sub write_geoip2_dbs {
331
- _write_geoip2_db( @{$_}, 'Test' )
332
- for (
333
- [ 'Anonymous-IP', 1 ],
334
- [ 'City', 0 ],
335
- [ 'Connection-Type', 0 ],
336
- [ 'Country', 0 ],
337
- [ 'Domain', 0 ],
338
- [ 'Enterprise', 0 ],
339
- [ 'ISP', 0 ],
340
- [ 'Precision-City', 0 ],
341
- [ 'Precision-ISP', 0 ]
342
- );
343
- }
344
-
345
- sub write_broken_geoip2_city_db {
346
- no warnings 'redefine';
347
-
348
- # This is how we _used_ to encode doubles. Storing them this way with the
349
- # current reader tools can lead to weird errors. This broken database is a
350
- # good way to test the robustness of reader code in the face of broken
351
- # databases.
352
- local *MaxMind::DB::Writer::Serializer::_encode_double = sub {
353
- my $self = shift;
354
- my $value = shift;
355
-
356
- $self->_simple_encode( double => $value );
357
- };
358
-
359
- _write_geoip2_db( 'City', 0, 'Test Broken Double Format' );
360
- }
361
-
362
- {
363
- my %type_map = (
364
- accuracy_radius => 'uint16',
365
- autonomous_system_number => 'uint32',
366
- autonomous_system_organization => 'utf8_string',
367
- cellular => 'uint16',
368
- city => 'map',
369
- confidence => 'uint16',
370
- continent => 'map',
371
- country => 'map',
372
- geoname_id => 'uint32',
373
- isp => 'utf8_string',
374
- latitude => 'double',
375
- location => 'map',
376
- longitude => 'double',
377
- metro_code => 'uint16',
378
- names => 'map',
379
- organization => 'utf8_string',
380
- postal => 'map',
381
- registered_country => 'map',
382
- represented_country => 'map',
383
- subdivisions => [ 'array', 'map' ],
384
- traits => 'map',
385
- );
386
-
387
- my $type_cb = sub {
388
- return 'boolean' if $_[0] =~ /^is_/;
389
- return $type_map{ $_[0] } // 'utf8_string';
390
- };
391
-
392
- sub _write_geoip2_db {
393
- my $type = shift;
394
- my $populate_all_networks = shift;
395
- my $description = shift;
396
-
397
- my $writer = MaxMind::DB::Writer::Tree->new(
398
- ip_version => 6,
399
- record_size => 28,
400
- ip_version => 6,
401
- database_type => "GeoIP2-$type",
402
- languages => [ 'en', $type eq 'City' ? ('zh') : () ],
403
- description => {
404
- en =>
405
- "GeoIP2 $type $description Database (fake GeoIP2 data, for example purposes only)",
406
- $type eq 'City' ? ( zh => '小型数据库' ) : (),
407
- },
408
- alias_ipv6_to_ipv4 => 1,
409
- map_key_type_callback => $type_cb,
410
- );
411
-
412
- _populate_all_networks($writer) if $populate_all_networks;
413
-
414
- my $nodes = decode_json(
415
- read_file(
416
- "$Dir/../source-data/GeoIP2-$type-Test.json",
417
- binmode => ':raw'
418
- )
419
- );
420
-
421
- for my $node (@$nodes) {
422
- for my $network ( keys %$node ) {
423
- $writer->insert_network(
424
- Net::Works::Network->new_from_string(
425
- string => $network
426
- ),
427
- $node->{$network}
428
- );
429
- }
430
- }
431
-
432
- my $suffix = $description =~ s/ /-/gr;
433
- open my $output_fh, '>', "$Dir/GeoIP2-$type-$suffix.mmdb";
434
- $writer->write_tree($output_fh);
435
- close $output_fh;
436
-
437
- return;
438
- }
439
- }
440
-
441
- sub _populate_all_networks {
442
- my $writer = shift;
443
-
444
- my $max_uint128 = uint128(0) - 1;
445
- my @networks = Net::Works::Network->range_as_subnets(
446
- Net::Works::Address->new_from_integer(
447
- integer => 0,
448
- version => 6,
449
- ),
450
- Net::Works::Address->new_from_integer(
451
- integer => $max_uint128,
452
- version => 6,
453
- ),
454
- );
455
-
456
- for my $network (@networks) {
457
- $writer->insert_network( $network => {} );
458
- }
459
- }
460
-
461
- sub write_no_ipv4_tree_db {
462
- my $subnets = shift;
463
-
464
- my $writer = MaxMind::DB::Writer::Tree->new(
465
- ip_version => 6,
466
- record_size => 24,
467
- ip_version => 6,
468
- database_type => 'MaxMind DB No IPv4 Search Tree',
469
- languages => ['en'],
470
- description => {
471
- en => 'MaxMind DB No IPv4 Search Tree',
472
- },
473
- root_data_type => 'utf8_string',
474
- map_key_type_callback => sub { {} },
475
- );
476
-
477
- my $subnet = Net::Works::Network->new_from_string( string => '::/64' );
478
- $writer->insert_network( $subnet, $subnet->as_string() );
479
-
480
- open my $output_fh, '>', "$Dir/MaxMind-DB-no-ipv4-search-tree.mmdb";
481
- $writer->write_tree($output_fh);
482
- close $output_fh;
483
-
484
- return;
485
- }
486
-
487
- # The point of this database is to provide something where we can test looking
488
- # up a single value. In other words, each IP address points to a non-compound
489
- # value, a string rather than a map or array.
490
- sub write_no_map_db {
491
- my $subnets = shift;
492
-
493
- my $writer = MaxMind::DB::Writer::Tree->new(
494
- ip_version => 4,
495
- record_size => 24,
496
- database_type => 'MaxMind DB String Value Entries',
497
- languages => ['en'],
498
- description => {
499
- en =>
500
- 'MaxMind DB String Value Entries (no maps or arrays as values)',
501
- },
502
- root_data_type => 'utf8_string',
503
- map_key_type_callback => sub { {} },
504
- );
505
-
506
- for my $subnet ( @{$subnets} ) {
507
- $writer->insert_network( $subnet, $subnet->as_string() );
508
- }
509
-
510
- open my $output_fh, '>', "$Dir/MaxMind-DB-string-value-entries.mmdb";
511
- $writer->write_tree($output_fh);
512
- close $output_fh;
513
-
514
- return;
515
- }
516
-
517
- sub write_test_serialization_data {
518
- my $serializer = MaxMind::DB::Writer::Serializer->new(
519
- map_key_type_callback => sub { 'utf8_string' } );
520
-
521
- $serializer->store_data( map => { long_key => 'long_value1' } );
522
- $serializer->store_data( map => { long_key => 'long_value2' } );
523
- $serializer->store_data( map => { long_key2 => 'long_value1' } );
524
- $serializer->store_data( map => { long_key2 => 'long_value2' } );
525
- $serializer->store_data( map => { long_key => 'long_value1' } );
526
- $serializer->store_data( map => { long_key2 => 'long_value2' } );
527
-
528
- open my $fh, '>', 'maps-with-pointers.raw';
529
- print {$fh} ${ $serializer->buffer() }
530
- or die "Cannot write to maps-with-pointers.raw: $!";
531
- close $fh;
532
-
533
- return;
534
- }
535
-
536
- sub write_db_with_metadata_pointers {
537
- my $repeated_string = 'Lots of pointers in metadata';
538
- my $writer = MaxMind::DB::Writer::Tree->new(
539
- ip_version => 6,
540
- record_size => 24,
541
- map_key_type_callback => sub { 'utf8_string' },
542
- database_type => $repeated_string,
543
- languages => [ 'en', 'es', 'zh' ],
544
- description => {
545
- en => $repeated_string,
546
- es => $repeated_string,
547
- zh => $repeated_string,
548
- },
549
-
550
- );
551
-
552
- _populate_all_networks($writer);
553
-
554
- open my $fh, '>', 'MaxMind-DB-test-metadata-pointers.mmdb';
555
-
556
- $writer->write_tree($fh);
557
-
558
- close $fh;
559
- }
560
-
561
- main();
@@ -1,5 +0,0 @@
1
- [PerlTidy]
2
- select = **/*.{pl,pm,t}
3
-
4
- [JSON]
5
- select = **/*.json
Binary file
Binary file