Documentation ¶
Overview ¶
Package geoip contains implementations of the GeoIP database for AdGuard DNS.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultCountryTopASNs = map[Country]ASN{}/* 233 elements not displayed */
DefaultCountryTopASNs is a mapping of a country to their top ASNs.
var DefaultTopASNs = container.NewMapSet[ASN](
137,
174,
209,
224,
559,
577,
701,
714,
719,
766,
786,
803,
812,
852,
855,
967,
984,
1103,
1136,
1213,
1221,
1241,
1257,
1267,
1299,
1403,
1547,
1653,
1659,
1680,
1741,
1756,
1759,
1764,
1835,
1836,
1853,
1897,
1930,
1955,
2018,
2107,
2108,
2110,
2116,
2119,
2200,
2497,
2514,
2516,
2518,
2519,
2527,
2547,
2586,
2588,
2602,
2607,
2609,
2611,
2740,
2843,
2847,
2850,
2852,
2856,
2860,
3132,
3209,
3212,
3215,
3216,
3221,
3223,
3225,
3238,
3243,
3249,
3255,
3258,
3269,
3292,
3301,
3303,
3308,
3320,
3326,
3329,
3342,
3352,
3356,
3363,
3462,
3549,
3559,
3605,
3695,
3737,
3741,
3758,
3786,
3790,
3816,
3855,
4007,
4134,
4181,
4230,
4538,
4609,
4616,
4638,
4651,
4657,
4685,
4713,
4721,
4725,
4739,
4760,
4761,
4764,
4766,
4768,
4771,
4773,
4775,
4780,
4788,
4804,
4808,
4812,
4817,
4818,
4837,
4847,
5089,
5378,
5384,
5390,
5391,
5408,
5410,
5413,
5416,
5432,
5466,
5483,
5518,
5532,
5578,
5603,
5607,
5610,
5617,
5639,
5645,
5650,
5713,
5769,
5786,
6057,
6079,
6128,
6147,
6167,
6181,
6306,
6327,
6400,
6407,
6535,
6568,
6639,
6661,
6677,
6682,
6697,
6700,
6703,
6713,
6730,
6739,
6752,
6758,
6772,
6799,
6802,
6805,
6810,
6821,
6830,
6848,
6849,
6855,
6866,
6871,
6876,
6877,
6939,
7018,
7029,
7057,
7122,
7131,
7303,
7315,
7418,
7438,
7482,
7497,
7522,
7524,
7545,
7552,
7642,
7679,
7713,
7727,
7738,
7794,
7862,
7922,
7992,
8014,
8048,
8053,
8075,
8151,
8167,
8193,
8200,
8220,
8251,
8257,
8285,
8290,
8301,
8339,
8346,
8359,
8368,
8369,
8374,
8376,
8386,
8399,
8400,
8402,
8412,
8422,
8437,
8445,
8447,
8449,
8452,
8462,
8468,
8473,
8517,
8540,
8542,
8544,
8551,
8560,
8585,
8612,
8632,
8661,
8680,
8681,
8697,
8699,
8708,
8717,
8728,
8758,
8764,
8767,
8771,
8778,
8781,
8814,
8818,
8821,
8847,
8849,
8866,
8881,
8896,
8926,
8948,
8953,
8966,
8978,
8990,
9002,
9008,
9009,
9031,
9038,
9044,
9050,
9051,
9063,
9070,
9085,
9105,
9119,
9121,
9123,
9125,
9129,
9145,
9146,
9155,
9158,
9198,
9199,
9231,
9241,
9245,
9246,
9249,
9260,
9269,
9299,
9304,
9312,
9316,
9318,
9329,
9335,
9341,
9351,
9354,
9365,
9381,
9416,
9443,
9471,
9484,
9500,
9506,
9534,
9541,
9587,
9595,
9605,
9617,
9644,
9674,
9751,
9790,
9808,
9824,
9829,
9845,
9873,
9902,
9908,
9919,
9922,
9924,
9930,
9931,
9934,
9981,
9988,
10010,
10013,
10030,
10036,
10066,
10075,
10094,
10099,
10101,
10103,
10118,
10131,
10139,
10143,
10214,
10219,
10222,
10226,
10269,
10292,
10299,
10396,
10429,
10474,
10617,
10620,
10796,
10834,
11014,
11081,
11139,
11172,
11232,
11259,
11260,
11269,
11290,
11315,
11351,
11367,
11426,
11427,
11492,
11556,
11562,
11580,
11594,
11664,
11776,
11814,
11816,
11830,
11845,
11888,
11992,
12046,
12066,
12083,
12091,
12252,
12271,
12297,
12301,
12302,
12322,
12334,
12338,
12353,
12361,
12365,
12389,
12390,
12392,
12400,
12406,
12414,
12426,
12430,
12436,
12444,
12455,
12479,
12491,
12508,
12552,
12570,
12576,
12578,
12597,
12605,
12620,
12668,
12684,
12709,
12714,
12716,
12735,
12741,
12754,
12764,
12810,
12829,
12849,
12874,
12876,
12912,
12929,
12946,
12958,
12969,
12975,
12978,
12997,
13000,
13030,
13036,
13037,
13045,
13046,
13092,
13099,
13110,
13122,
13124,
13127,
13156,
13170,
13188,
13189,
13194,
13208,
13213,
13280,
13285,
13306,
13335,
13489,
13771,
13999,
14061,
14080,
14117,
14232,
14259,
14434,
14522,
14534,
14537,
14593,
14618,
14638,
14709,
14754,
14813,
14868,
14979,
14988,
15146,
15169,
15311,
15344,
15366,
15377,
15378,
15383,
15389,
15397,
15399,
15404,
15419,
15433,
15435,
15440,
15457,
15474,
15480,
15502,
15511,
15516,
15525,
15547,
15557,
15600,
15614,
15623,
15659,
15704,
15706,
15723,
15735,
15751,
15774,
15796,
15802,
15805,
15808,
15836,
15895,
15897,
15924,
15943,
15958,
15962,
15964,
15965,
15994,
16010,
16019,
16028,
16058,
16082,
16086,
16116,
16117,
16135,
16178,
16190,
16202,
16223,
16229,
16232,
16246,
16276,
16322,
16333,
16342,
16345,
16347,
16367,
16413,
16437,
16509,
16591,
16592,
16625,
16629,
16637,
16705,
16735,
16814,
16906,
16960,
17072,
17079,
17400,
17411,
17421,
17451,
17458,
17470,
17480,
17488,
17501,
17506,
17511,
17529,
17547,
17551,
17552,
17557,
17621,
17622,
17623,
17639,
17665,
17676,
17698,
17709,
17716,
17726,
17809,
17816,
17828,
17849,
17853,
17858,
17882,
17893,
17924,
17976,
17993,
18001,
18004,
18021,
18024,
18049,
18053,
18081,
18106,
18126,
18144,
18182,
18199,
18200,
18209,
18371,
18390,
18399,
18403,
18412,
18419,
18429,
18734,
18809,
18822,
18840,
18881,
19108,
19114,
19180,
19182,
19246,
19422,
19429,
19624,
19626,
19711,
19863,
19978,
20001,
20011,
20055,
20057,
20115,
20207,
20255,
20294,
20299,
20365,
20473,
20485,
20545,
20582,
20634,
20661,
20676,
20719,
20723,
20771,
20776,
20804,
20845,
20846,
20860,
20875,
20880,
20910,
20911,
20940,
20963,
20978,
21001,
21003,
21021,
21040,
21050,
21107,
21183,
21211,
21230,
21232,
21246,
21271,
21277,
21283,
21299,
21334,
21351,
21412,
21430,
21450,
21491,
21497,
21502,
21559,
21575,
21599,
21744,
21804,
21826,
21859,
21928,
21949,
21996,
22047,
22069,
22085,
22423,
22581,
22652,
22690,
22724,
22773,
22869,
22884,
22927,
22933,
22995,
23114,
23201,
23243,
23383,
23487,
23520,
23655,
23657,
23673,
23674,
23688,
23693,
23700,
23724,
23750,
23752,
23860,
23889,
23900,
23923,
23944,
23955,
23956,
23969,
24016,
24086,
24088,
24157,
24158,
24163,
24164,
24165,
24183,
24186,
24203,
24309,
24337,
24378,
24389,
24400,
24432,
24439,
24441,
24444,
24445,
24492,
24499,
24547,
24550,
24559,
24560,
24589,
24608,
24631,
24634,
24645,
24651,
24691,
24722,
24751,
24757,
24800,
24812,
24822,
24835,
24852,
24863,
24877,
24889,
24921,
24940,
24955,
25019,
25094,
25106,
25117,
25133,
25135,
25139,
25144,
25159,
25184,
25190,
25229,
25248,
25250,
25255,
25273,
25310,
25369,
25374,
25375,
25400,
25406,
25429,
25441,
25447,
25454,
25467,
25471,
25472,
25491,
25512,
25513,
25528,
25543,
25607,
25620,
25668,
26130,
26210,
26317,
26599,
26611,
26615,
26617,
26932,
27651,
27653,
27660,
27665,
27668,
27672,
27694,
27695,
27696,
27699,
27708,
27717,
27725,
27729,
27734,
27738,
27742,
27745,
27747,
27757,
27759,
27768,
27773,
27775,
27781,
27789,
27796,
27800,
27813,
27831,
27833,
27837,
27839,
27843,
27866,
27876,
27882,
27884,
27887,
27889,
27895,
27901,
27903,
27923,
27924,
27927,
27928,
27932,
27947,
27951,
27955,
27983,
27984,
27988,
27995,
28006,
28009,
28015,
28022,
28024,
28032,
28036,
28048,
28049,
28075,
28094,
28103,
28104,
28118,
28126,
28146,
28182,
28186,
28198,
28201,
28210,
28220,
28258,
28270,
28343,
28398,
28403,
28458,
28469,
28481,
28509,
28512,
28530,
28531,
28532,
28534,
28536,
28541,
28545,
28548,
28554,
28555,
28573,
28598,
28649,
28668,
28683,
28685,
28717,
28725,
28753,
28760,
28787,
28812,
28840,
28851,
28854,
28878,
28884,
28885,
28919,
28952,
28972,
29027,
29030,
29049,
29061,
29070,
29084,
29091,
29119,
29124,
29170,
29182,
29208,
29238,
29244,
29247,
29256,
29286,
29310,
29314,
29348,
29355,
29357,
29384,
29405,
29447,
29465,
29485,
29492,
29497,
29518,
29544,
29545,
29555,
29571,
29580,
29582,
29584,
29600,
29614,
29657,
29687,
29695,
29975,
30036,
30058,
30272,
30526,
30600,
30619,
30689,
30722,
30764,
30844,
30848,
30873,
30896,
30982,
30983,
30985,
30986,
30990,
30992,
30999,
31012,
31027,
31037,
31042,
31115,
31117,
31122,
31126,
31127,
31133,
31143,
31148,
31163,
31200,
31204,
31205,
31213,
31224,
31242,
31245,
31246,
31250,
31252,
31272,
31287,
31390,
31404,
31423,
31435,
31452,
31499,
31510,
31543,
31549,
31615,
31655,
31679,
31689,
31721,
31725,
31863,
31898,
31960,
32020,
32098,
32189,
32398,
32787,
32860,
33363,
33392,
33567,
33576,
33582,
33588,
33763,
33765,
33771,
33779,
33781,
33788,
33796,
33874,
33885,
33915,
33922,
33943,
33947,
33983,
34001,
34058,
34087,
34170,
34187,
34224,
34244,
34245,
34295,
34296,
34306,
34318,
34362,
34376,
34447,
34458,
34471,
34515,
34524,
34525,
34533,
34547,
34557,
34569,
34594,
34661,
34666,
34700,
34702,
34705,
34718,
34724,
34743,
34772,
34779,
34797,
34803,
34820,
34857,
34876,
34916,
34927,
34977,
34984,
34989,
35046,
35047,
35091,
35104,
35132,
35141,
35158,
35179,
35191,
35197,
35223,
35228,
35244,
35297,
35311,
35320,
35328,
35346,
35362,
35432,
35444,
35457,
35518,
35546,
35549,
35567,
35612,
35613,
35699,
35706,
35725,
35729,
35753,
35790,
35805,
35807,
35819,
35892,
35900,
35911,
36290,
36408,
36511,
36549,
36599,
36864,
36865,
36866,
36868,
36873,
36874,
36881,
36884,
36890,
36892,
36902,
36903,
36905,
36907,
36908,
36909,
36912,
36913,
36914,
36916,
36920,
36923,
36924,
36925,
36926,
36935,
36937,
36939,
36947,
36955,
36958,
36959,
36962,
36963,
36965,
36968,
36972,
36974,
36977,
36988,
36992,
36994,
36996,
36998,
36999,
37002,
37006,
37009,
37012,
37014,
37020,
37027,
37030,
37035,
37037,
37049,
37053,
37054,
37057,
37061,
37063,
37069,
37073,
37075,
37076,
37084,
37090,
37094,
37098,
37100,
37105,
37110,
37113,
37119,
37123,
37124,
37129,
37133,
37136,
37141,
37143,
37148,
37154,
37164,
37168,
37173,
37182,
37183,
37184,
37187,
37189,
37190,
37196,
37203,
37204,
37205,
37208,
37211,
37215,
37219,
37223,
37228,
37229,
37233,
37254,
37257,
37273,
37282,
37284,
37287,
37294,
37303,
37305,
37309,
37313,
37315,
37323,
37329,
37332,
37334,
37336,
37337,
37340,
37342,
37343,
37349,
37350,
37358,
37371,
37376,
37385,
37395,
37406,
37410,
37414,
37424,
37425,
37430,
37440,
37447,
37449,
37451,
37453,
37457,
37460,
37461,
37463,
37473,
37475,
37480,
37487,
37492,
37503,
37508,
37517,
37518,
37524,
37526,
37529,
37531,
37532,
37541,
37542,
37545,
37550,
37552,
37559,
37563,
37568,
37569,
37571,
37575,
37577,
37580,
37582,
37584,
37594,
37604,
37611,
37612,
37614,
37616,
37622,
37638,
37642,
37645,
37649,
37654,
37662,
37665,
37671,
37675,
37677,
37678,
37680,
37682,
37693,
37697,
37705,
37721,
37963,
38009,
38067,
38077,
38107,
38136,
38172,
38176,
38195,
38198,
38201,
38203,
38209,
38235,
38247,
38264,
38266,
38322,
38442,
38466,
38511,
38553,
38562,
38565,
38600,
38623,
38742,
38800,
38805,
38819,
38841,
38851,
38875,
38901,
38987,
38999,
39007,
39010,
39013,
39032,
39067,
39074,
39120,
39122,
39184,
39216,
39232,
39246,
39251,
39273,
39279,
39280,
39344,
39374,
39397,
39402,
39440,
39455,
39501,
39603,
39608,
39611,
39615,
39642,
39686,
39699,
39766,
39824,
39826,
39891,
39906,
39927,
40029,
40786,
40788,
40945,
40980,
41068,
41096,
41124,
41164,
41202,
41228,
41230,
41329,
41330,
41371,
41378,
41454,
41496,
41549,
41557,
41563,
41564,
41627,
41676,
41704,
41733,
41738,
41745,
41750,
41798,
41833,
41871,
41872,
41878,
41897,
41922,
41956,
41966,
41997,
42003,
42013,
42082,
42083,
42109,
42183,
42189,
42298,
42306,
42313,
42334,
42337,
42437,
42455,
42473,
42532,
42541,
42560,
42571,
42580,
42581,
42610,
42652,
42689,
42708,
42713,
42772,
42779,
42828,
42837,
42841,
42863,
42905,
42908,
42912,
42925,
42961,
42991,
43019,
43030,
43060,
43061,
43070,
43139,
43197,
43205,
43242,
43248,
43256,
43350,
43375,
43451,
43452,
43513,
43529,
43533,
43612,
43627,
43641,
43700,
43733,
43754,
43766,
43769,
43824,
43883,
43905,
43925,
43939,
43940,
43972,
44021,
44027,
44034,
44086,
44087,
44090,
44134,
44143,
44213,
44217,
44218,
44234,
44244,
44306,
44324,
44327,
44377,
44384,
44391,
44395,
44477,
44483,
44489,
44515,
44558,
44566,
44631,
44702,
44708,
44725,
44735,
44869,
44925,
45090,
45102,
45143,
45177,
45178,
45179,
45193,
45245,
45271,
45305,
45345,
45349,
45355,
45356,
45361,
45410,
45430,
45458,
45461,
45498,
45543,
45558,
45588,
45609,
45629,
45637,
45650,
45669,
45700,
45754,
45758,
45763,
45766,
45773,
45879,
45891,
45899,
45903,
45905,
45916,
45918,
45925,
45935,
45960,
46198,
46408,
46650,
46868,
47110,
47114,
47139,
47159,
47169,
47204,
47217,
47232,
47237,
47253,
47292,
47331,
47377,
47394,
47474,
47485,
47524,
47583,
47588,
47589,
47790,
47794,
47798,
47883,
47887,
47890,
47898,
47943,
47956,
47962,
48014,
48092,
48161,
48181,
48190,
48206,
48252,
48260,
48271,
48288,
48431,
48437,
48480,
48492,
48503,
48506,
48551,
48629,
48675,
48685,
48695,
48728,
48789,
48830,
48832,
48847,
48887,
48917,
48944,
48966,
49020,
49056,
49100,
49101,
49110,
49113,
49115,
49117,
49129,
49223,
49242,
49273,
49285,
49472,
49561,
49628,
49724,
49770,
49800,
49808,
49840,
49847,
49870,
49889,
49902,
49911,
49981,
50010,
50053,
50181,
50223,
50251,
50261,
50266,
50274,
50334,
50349,
50463,
50467,
50482,
50500,
50506,
50563,
50581,
50593,
50613,
50616,
50635,
50670,
50685,
50749,
50767,
50770,
50810,
50821,
50825,
50920,
50925,
50953,
50959,
50962,
50973,
50979,
51018,
51020,
51056,
51069,
51104,
51110,
51142,
51167,
51175,
51184,
51207,
51247,
51265,
51336,
51342,
51346,
51375,
51407,
51430,
51495,
51500,
51504,
51582,
51645,
51653,
51684,
51765,
51784,
51809,
51825,
51847,
51852,
51896,
51964,
52075,
52228,
52233,
52238,
52242,
52253,
52257,
52260,
52262,
52263,
52286,
52300,
52312,
52323,
52341,
52361,
52362,
52363,
52373,
52381,
52398,
52405,
52412,
52433,
52436,
52444,
52455,
52465,
52468,
52471,
52613,
52783,
52974,
53006,
53338,
53667,
53764,
54198,
54614,
54994,
55033,
55081,
55329,
55330,
55391,
55392,
55424,
55427,
55430,
55501,
55577,
55636,
55685,
55699,
55720,
55769,
55805,
55821,
55836,
55850,
55853,
55900,
55915,
55933,
55943,
55944,
56017,
56030,
56040,
56041,
56042,
56044,
56046,
56047,
56048,
56055,
56089,
56099,
56120,
56167,
56207,
56231,
56262,
56293,
56300,
56309,
56329,
56349,
56369,
56410,
56456,
56478,
56561,
56568,
56653,
56655,
56656,
56665,
56696,
56704,
56902,
56926,
56971,
56983,
57000,
57013,
57016,
57043,
57070,
57112,
57134,
57218,
57248,
57256,
57269,
57293,
57344,
57370,
57374,
57388,
57389,
57391,
57443,
57513,
57564,
57566,
57606,
57630,
57695,
57728,
57743,
57760,
57761,
57764,
57778,
57794,
57826,
57852,
57869,
57888,
58044,
58056,
58061,
58065,
58118,
58130,
58224,
58254,
58299,
58309,
58322,
58453,
58460,
58461,
58485,
58504,
58507,
58524,
58539,
58541,
58542,
58610,
58656,
58682,
58689,
58715,
58717,
58731,
58821,
58895,
58945,
58952,
59125,
59127,
59253,
59257,
59317,
59318,
59355,
59362,
59381,
59463,
59497,
59588,
59625,
59668,
59702,
59729,
59860,
59861,
59890,
59989,
60068,
60111,
60171,
60258,
60294,
60352,
60367,
60372,
60377,
60415,
60471,
60533,
60587,
60636,
60656,
60690,
60725,
60754,
60757,
60781,
60806,
60976,
60999,
61010,
61079,
61112,
61135,
61143,
61174,
61189,
61211,
61272,
61275,
61287,
61307,
61317,
61424,
61437,
61449,
61461,
61466,
61468,
61478,
61512,
62005,
62013,
62059,
62161,
62179,
62211,
62214,
62240,
62250,
62282,
62336,
62419,
62563,
62627,
62651,
63023,
63199,
63526,
63852,
63859,
63888,
63949,
63962,
63969,
63991,
64037,
64043,
64050,
64073,
64098,
64105,
64126,
64134,
64443,
64453,
64466,
131090,
131111,
131178,
131207,
131267,
131284,
131322,
131325,
131429,
131445,
131464,
131471,
131584,
131591,
131596,
131602,
131627,
131769,
132021,
132045,
132061,
132080,
132104,
132148,
132165,
132167,
132173,
132199,
132203,
132204,
132222,
132255,
132298,
132429,
132447,
132449,
132462,
132468,
132471,
132525,
132608,
132618,
132831,
132857,
133012,
133076,
133192,
133199,
133200,
133206,
133334,
133384,
133385,
133480,
133481,
133524,
133533,
133606,
133612,
133613,
133623,
133661,
133752,
133774,
133875,
133894,
133897,
133982,
134090,
134113,
134134,
134204,
134220,
134356,
134420,
134489,
134562,
134651,
134674,
134697,
134707,
134714,
134715,
134732,
134739,
134762,
134768,
134783,
134788,
134840,
134968,
134972,
134995,
135043,
135126,
135298,
135341,
135371,
135375,
135376,
135377,
135405,
135407,
135409,
135427,
135477,
135478,
135589,
135600,
135607,
135887,
135905,
136030,
136039,
136093,
136141,
136167,
136195,
136210,
136229,
136238,
136255,
136258,
136380,
136384,
136400,
136442,
136454,
136479,
136480,
136515,
136525,
136557,
136617,
136780,
136787,
136873,
136907,
136919,
136920,
136969,
136994,
137047,
137080,
137187,
137226,
137409,
137412,
137424,
137449,
137453,
137503,
137526,
137561,
137693,
137697,
137872,
137895,
137959,
137967,
137989,
138089,
138164,
138167,
138168,
138179,
138197,
138322,
138346,
138368,
138384,
138423,
138500,
138529,
138558,
138590,
138640,
138655,
138754,
138886,
138915,
138934,
138964,
138965,
138997,
139003,
139009,
139029,
139043,
139049,
139224,
139238,
139609,
139628,
139651,
139741,
139759,
139820,
139831,
139837,
139841,
139879,
139898,
139922,
139952,
139967,
139981,
139994,
140045,
140061,
140072,
140091,
140096,
140220,
140292,
140401,
140457,
140499,
140504,
140707,
140867,
140900,
140989,
141015,
141024,
141031,
141039,
141140,
141145,
141177,
141216,
141224,
141342,
141421,
141607,
141680,
141681,
141711,
141767,
141778,
141995,
142065,
142295,
142386,
142539,
142647,
147049,
147302,
149034,
149173,
149359,
149360,
149419,
149456,
149487,
149660,
149707,
149771,
150153,
150371,
150407,
150683,
150692,
150721,
150748,
150750,
150774,
150797,
151080,
151341,
151396,
151983,
152140,
152317,
152596,
152605,
152677,
196640,
196735,
196838,
196874,
196925,
196961,
197207,
197225,
197248,
197301,
197350,
197398,
197423,
197540,
197556,
197706,
197716,
197830,
197862,
197882,
197897,
198002,
198004,
198023,
198068,
198247,
198256,
198265,
198279,
198288,
198440,
198471,
198482,
198499,
198589,
198605,
198668,
198820,
198890,
198961,
198966,
199081,
199128,
199140,
199155,
199276,
199326,
199374,
199469,
199490,
199493,
199524,
199620,
199636,
199707,
199731,
199739,
199768,
199785,
199811,
200019,
200134,
200154,
200313,
200355,
200446,
200590,
200612,
200640,
200651,
200665,
200698,
200724,
200736,
200740,
200845,
200865,
200899,
201019,
201073,
201089,
201120,
201167,
201187,
201241,
201249,
201322,
201363,
201411,
201502,
201505,
201577,
201589,
201601,
201603,
201701,
201746,
201749,
201767,
201776,
201838,
201884,
201890,
201986,
201997,
202023,
202087,
202098,
202103,
202254,
202293,
202422,
202433,
202441,
202468,
202498,
202558,
202561,
202613,
202618,
202632,
202635,
202651,
202662,
202710,
202759,
202870,
202921,
202931,
202940,
202960,
202987,
203020,
203136,
203206,
203214,
203217,
203257,
203409,
203424,
203448,
203451,
203561,
203622,
203675,
203680,
203811,
203877,
203912,
203916,
203936,
203953,
203964,
203971,
203995,
203999,
204020,
204106,
204108,
204151,
204165,
204170,
204274,
204279,
204317,
204342,
204403,
204410,
204457,
204565,
204595,
204716,
204802,
204816,
204918,
204957,
204986,
205015,
205110,
205244,
205254,
205293,
205367,
205368,
205371,
205547,
205638,
205645,
205647,
205714,
205800,
205832,
205889,
205984,
206026,
206065,
206067,
206119,
206170,
206206,
206238,
206260,
206262,
206283,
206358,
206375,
206391,
206406,
206471,
206485,
206519,
206557,
206610,
206666,
206783,
206804,
206892,
206920,
206928,
206977,
207044,
207097,
207137,
207159,
207192,
207251,
207348,
207369,
207375,
207474,
207569,
207589,
207713,
207782,
207810,
207876,
207980,
207990,
207991,
208286,
208320,
208324,
208339,
208448,
208570,
208592,
208671,
208730,
208734,
208859,
208864,
208905,
208972,
208997,
209012,
209046,
209049,
209193,
209240,
209262,
209277,
209302,
209360,
209424,
209442,
209491,
209835,
209839,
209854,
209948,
210003,
210016,
210021,
210022,
210125,
210147,
210218,
210278,
210315,
210402,
210616,
210625,
210644,
210693,
210740,
210797,
210964,
211028,
211057,
211210,
211211,
211235,
211309,
211322,
211356,
211385,
211450,
211468,
211504,
211555,
211559,
211689,
211908,
211995,
212183,
212238,
212330,
212449,
212531,
212572,
212607,
212616,
212637,
212645,
212655,
212661,
212766,
212898,
212986,
212999,
213139,
213155,
213295,
213320,
213398,
213402,
214739,
214798,
215052,
215284,
215287,
215346,
215355,
215416,
215421,
215423,
215501,
215540,
215733,
215746,
215886,
215910,
216071,
216086,
216139,
216200,
216312,
216325,
216374,
216463,
262145,
262146,
262159,
262179,
262181,
262186,
262191,
262197,
262202,
262210,
262223,
262234,
262239,
262241,
262248,
262253,
262262,
262287,
262354,
262378,
262468,
262481,
262494,
262589,
262663,
262753,
262773,
262916,
262932,
263073,
263170,
263210,
263218,
263222,
263224,
263238,
263242,
263245,
263292,
263327,
263684,
263686,
263689,
263694,
263698,
263703,
263717,
263725,
263749,
263750,
263751,
263759,
263761,
263762,
263763,
263765,
263783,
263785,
263791,
263792,
263805,
263824,
263980,
264221,
264605,
264609,
264628,
264635,
264637,
264640,
264642,
264645,
264646,
264663,
264676,
264685,
264694,
264696,
264731,
264733,
264738,
264744,
264750,
264756,
264770,
264778,
264779,
264780,
264783,
264796,
264814,
264821,
264825,
264837,
264838,
264847,
264984,
265509,
265540,
265561,
265594,
265606,
265608,
265631,
265632,
265636,
265641,
265675,
265684,
265688,
265691,
265711,
265721,
265727,
265735,
265757,
265767,
265780,
265798,
265799,
265816,
265818,
265822,
265855,
265867,
266445,
266668,
266673,
266677,
266686,
266698,
266704,
266716,
266725,
266734,
266755,
266757,
266792,
266802,
266812,
266814,
266815,
266841,
266853,
266858,
266860,
266876,
266880,
266893,
266894,
266904,
267684,
267685,
267692,
267699,
267705,
267708,
267713,
267749,
267761,
267765,
267790,
267795,
267797,
267803,
267809,
267828,
267845,
267846,
267869,
267882,
267904,
267920,
268323,
269036,
269729,
269730,
269733,
269734,
269738,
269749,
269750,
269769,
269780,
269782,
269783,
269797,
269804,
269806,
269816,
269820,
269822,
269831,
269832,
269838,
269840,
269846,
269853,
269862,
269878,
269894,
269898,
269901,
269908,
269918,
269919,
269921,
269926,
269927,
269931,
269934,
269936,
269940,
269946,
269955,
269960,
269964,
269965,
269976,
269981,
269984,
269989,
270007,
270026,
270029,
270035,
270036,
270049,
270052,
270058,
270068,
270071,
270073,
270096,
270098,
270108,
270158,
270161,
271773,
271781,
271785,
271791,
271795,
271806,
271808,
271814,
271816,
271819,
271822,
271835,
271868,
271874,
271899,
271907,
271909,
271911,
271929,
271930,
271932,
271933,
271935,
271942,
271945,
271951,
271962,
271965,
271971,
271982,
272011,
272019,
272026,
272027,
272037,
272059,
272062,
272065,
272083,
272095,
272099,
272102,
272106,
272110,
272112,
272120,
272122,
272123,
272134,
272809,
272818,
272836,
272851,
272882,
272906,
272914,
272916,
272921,
272955,
272978,
272991,
273000,
273054,
273063,
273067,
273078,
273093,
273113,
273133,
273155,
273171,
273172,
273231,
273237,
273309,
273843,
273844,
327687,
327693,
327697,
327700,
327707,
327712,
327714,
327716,
327724,
327728,
327738,
327747,
327750,
327756,
327760,
327765,
327768,
327769,
327770,
327776,
327782,
327786,
327794,
327795,
327798,
327799,
327802,
327804,
327814,
327819,
327828,
327829,
327830,
327862,
327863,
327864,
327871,
327879,
327885,
327900,
327901,
327903,
327907,
327931,
327934,
327941,
327972,
327975,
327987,
327990,
327991,
327992,
328001,
328061,
328068,
328073,
328079,
328088,
328111,
328118,
328136,
328140,
328169,
328181,
328191,
328196,
328198,
328200,
328207,
328223,
328228,
328250,
328253,
328258,
328282,
328284,
328286,
328297,
328304,
328310,
328316,
328319,
328331,
328341,
328358,
328411,
328436,
328442,
328443,
328469,
328471,
328473,
328479,
328480,
328488,
328490,
328494,
328510,
328514,
328517,
328535,
328539,
328546,
328549,
328570,
328581,
328586,
328590,
328594,
328600,
328604,
328605,
328610,
328611,
328614,
328619,
328628,
328638,
328659,
328676,
328697,
328702,
328708,
328717,
328727,
328734,
328753,
328755,
328770,
328777,
328817,
328824,
328835,
328844,
328849,
328850,
328856,
328857,
328858,
328880,
328895,
328899,
328923,
328939,
328943,
328950,
328954,
328959,
328961,
328965,
328975,
328977,
328979,
328987,
328988,
328993,
328997,
329006,
329014,
329027,
329028,
329029,
329044,
329048,
329078,
329082,
329101,
329103,
329126,
329129,
329135,
329155,
329167,
329169,
329170,
329179,
329183,
329192,
329205,
329211,
329219,
329227,
329253,
329254,
329255,
329261,
329274,
329301,
329373,
329387,
329390,
329411,
329415,
329422,
329437,
329472,
393275,
393629,
394311,
394381,
394684,
395561,
395570,
395965,
396304,
396338,
396357,
396420,
396982,
397961,
398228,
398721,
398901,
399444,
399498,
399724,
400099,
400619,
)
DefaultTopASNs contains all specially handled ASNs.
Functions ¶
This section is empty.
Types ¶
type Continent ¶
type Continent string
Continent represents a continent code used by MaxMind.
const ( // ContinentNone is an unknown continent code. ContinentNone Continent = "" // ContinentAF is Africa. ContinentAF Continent = "AF" // ContinentAN is Antarctica. ContinentAN Continent = "AN" // ContinentAS is Asia. ContinentAS Continent = "AS" // ContinentEU is Europe. ContinentEU Continent = "EU" // ContinentNA is North America. ContinentNA Continent = "NA" // ContinentOC is Oceania. ContinentOC Continent = "OC" // ContinentSA is South America. ContinentSA Continent = "SA" )
Continent code constants.
func NewContinent ¶
NewContinent converts s into a Continent while also validating it. Prefer to use this instead of a plain conversion.
type Country ¶
type Country string
Country represents an ISO 3166-1 alpha-2 country code.
const ( // CountryNone is an invalid or unknown country code. CountryNone Country = "" // CountryNotApplicable is the user-assigned ISO 3166-1 alpha-2 code used // when a country of origin cannot be determined due to a lack of // information, for example a response of the record type that doesn't // contain an IP address. CountryNotApplicable Country = "QN" // CountryXK is the user-assigned ISO 3166-1 alpha-2 code for Republic of // Kosovo. Kosovo does not have a recognized ISO 3166 code, but it is still // an entity whose user-assigned code is relatively common. CountryXK Country = "XK" // CountryAD is the ISO 3166-1 alpha-2 code for // Andorra. CountryAD Country = "AD" // CountryAE is the ISO 3166-1 alpha-2 code for // United Arab Emirates. CountryAE Country = "AE" // CountryAF is the ISO 3166-1 alpha-2 code for // Afghanistan. CountryAF Country = "AF" // CountryAG is the ISO 3166-1 alpha-2 code for // Antigua and Barbuda. CountryAG Country = "AG" // CountryAI is the ISO 3166-1 alpha-2 code for // Anguilla. CountryAI Country = "AI" // CountryAL is the ISO 3166-1 alpha-2 code for // Albania. CountryAL Country = "AL" // CountryAM is the ISO 3166-1 alpha-2 code for // Armenia. CountryAM Country = "AM" // CountryAO is the ISO 3166-1 alpha-2 code for // Angola. CountryAO Country = "AO" // CountryAQ is the ISO 3166-1 alpha-2 code for // Antarctica. CountryAQ Country = "AQ" // CountryAR is the ISO 3166-1 alpha-2 code for // Argentina. CountryAR Country = "AR" // CountryAS is the ISO 3166-1 alpha-2 code for // American Samoa. CountryAS Country = "AS" // CountryAT is the ISO 3166-1 alpha-2 code for // Austria. CountryAT Country = "AT" // CountryAU is the ISO 3166-1 alpha-2 code for // Australia. CountryAU Country = "AU" // CountryAW is the ISO 3166-1 alpha-2 code for // Aruba. CountryAW Country = "AW" // CountryAX is the ISO 3166-1 alpha-2 code for // Åland Islands. CountryAX Country = "AX" // CountryAZ is the ISO 3166-1 alpha-2 code for // Azerbaijan. CountryAZ Country = "AZ" // CountryBA is the ISO 3166-1 alpha-2 code for // Bosnia and Herzegovina. CountryBA Country = "BA" // CountryBB is the ISO 3166-1 alpha-2 code for // Barbados. CountryBB Country = "BB" // CountryBD is the ISO 3166-1 alpha-2 code for // Bangladesh. CountryBD Country = "BD" // CountryBE is the ISO 3166-1 alpha-2 code for // Belgium. CountryBE Country = "BE" // CountryBF is the ISO 3166-1 alpha-2 code for // Burkina Faso. CountryBF Country = "BF" // CountryBG is the ISO 3166-1 alpha-2 code for // Bulgaria. CountryBG Country = "BG" // CountryBH is the ISO 3166-1 alpha-2 code for // Bahrain. CountryBH Country = "BH" // CountryBI is the ISO 3166-1 alpha-2 code for // Burundi. CountryBI Country = "BI" // CountryBJ is the ISO 3166-1 alpha-2 code for // Benin. CountryBJ Country = "BJ" // CountryBL is the ISO 3166-1 alpha-2 code for // Saint Barthélemy. CountryBL Country = "BL" // CountryBM is the ISO 3166-1 alpha-2 code for // Bermuda. CountryBM Country = "BM" // CountryBN is the ISO 3166-1 alpha-2 code for // Brunei Darussalam. CountryBN Country = "BN" // CountryBO is the ISO 3166-1 alpha-2 code for // Bolivia, Plurinational State of. CountryBO Country = "BO" // CountryBQ is the ISO 3166-1 alpha-2 code for // Bonaire, Sint Eustatius and Saba. CountryBQ Country = "BQ" // CountryBR is the ISO 3166-1 alpha-2 code for // Brazil. CountryBR Country = "BR" // CountryBS is the ISO 3166-1 alpha-2 code for // Bahamas. CountryBS Country = "BS" // CountryBT is the ISO 3166-1 alpha-2 code for // Bhutan. CountryBT Country = "BT" // CountryBV is the ISO 3166-1 alpha-2 code for // Bouvet Island. CountryBV Country = "BV" // CountryBW is the ISO 3166-1 alpha-2 code for // Botswana. CountryBW Country = "BW" // CountryBY is the ISO 3166-1 alpha-2 code for // Belarus. CountryBY Country = "BY" // CountryBZ is the ISO 3166-1 alpha-2 code for // Belize. CountryBZ Country = "BZ" // CountryCA is the ISO 3166-1 alpha-2 code for // Canada. CountryCA Country = "CA" // CountryCC is the ISO 3166-1 alpha-2 code for // Cocos (Keeling) Islands. CountryCC Country = "CC" // CountryCD is the ISO 3166-1 alpha-2 code for // Congo, Democratic Republic of the. CountryCD Country = "CD" // CountryCF is the ISO 3166-1 alpha-2 code for // Central African Republic. CountryCF Country = "CF" // CountryCG is the ISO 3166-1 alpha-2 code for // Congo. CountryCG Country = "CG" // CountryCH is the ISO 3166-1 alpha-2 code for // Switzerland. CountryCH Country = "CH" // CountryCI is the ISO 3166-1 alpha-2 code for // Côte d'Ivoire. CountryCI Country = "CI" // CountryCK is the ISO 3166-1 alpha-2 code for // Cook Islands. CountryCK Country = "CK" // CountryCL is the ISO 3166-1 alpha-2 code for // Chile. CountryCL Country = "CL" // CountryCM is the ISO 3166-1 alpha-2 code for // Cameroon. CountryCM Country = "CM" // CountryCN is the ISO 3166-1 alpha-2 code for // China. CountryCN Country = "CN" // CountryCO is the ISO 3166-1 alpha-2 code for // Colombia. CountryCO Country = "CO" // CountryCR is the ISO 3166-1 alpha-2 code for // Costa Rica. CountryCR Country = "CR" // CountryCU is the ISO 3166-1 alpha-2 code for // Cuba. CountryCU Country = "CU" // CountryCV is the ISO 3166-1 alpha-2 code for // Cabo Verde. CountryCV Country = "CV" // CountryCW is the ISO 3166-1 alpha-2 code for // Curaçao. CountryCW Country = "CW" // CountryCX is the ISO 3166-1 alpha-2 code for // Christmas Island. CountryCX Country = "CX" // CountryCY is the ISO 3166-1 alpha-2 code for // Cyprus. CountryCY Country = "CY" // CountryCZ is the ISO 3166-1 alpha-2 code for // Czechia. CountryCZ Country = "CZ" // CountryDE is the ISO 3166-1 alpha-2 code for // Germany. CountryDE Country = "DE" // CountryDJ is the ISO 3166-1 alpha-2 code for // Djibouti. CountryDJ Country = "DJ" // CountryDK is the ISO 3166-1 alpha-2 code for // Denmark. CountryDK Country = "DK" // CountryDM is the ISO 3166-1 alpha-2 code for // Dominica. CountryDM Country = "DM" // CountryDO is the ISO 3166-1 alpha-2 code for // Dominican Republic. CountryDO Country = "DO" // CountryDZ is the ISO 3166-1 alpha-2 code for // Algeria. CountryDZ Country = "DZ" // CountryEC is the ISO 3166-1 alpha-2 code for // Ecuador. CountryEC Country = "EC" // CountryEE is the ISO 3166-1 alpha-2 code for // Estonia. CountryEE Country = "EE" // CountryEG is the ISO 3166-1 alpha-2 code for // Egypt. CountryEG Country = "EG" // CountryEH is the ISO 3166-1 alpha-2 code for // Western Sahara. CountryEH Country = "EH" // CountryER is the ISO 3166-1 alpha-2 code for // Eritrea. CountryER Country = "ER" // CountryES is the ISO 3166-1 alpha-2 code for // Spain. CountryES Country = "ES" // CountryET is the ISO 3166-1 alpha-2 code for // Ethiopia. CountryET Country = "ET" // CountryFI is the ISO 3166-1 alpha-2 code for // Finland. CountryFI Country = "FI" // CountryFJ is the ISO 3166-1 alpha-2 code for // Fiji. CountryFJ Country = "FJ" // CountryFK is the ISO 3166-1 alpha-2 code for // Falkland Islands (Malvinas). CountryFK Country = "FK" // CountryFM is the ISO 3166-1 alpha-2 code for // Micronesia, Federated States of. CountryFM Country = "FM" // CountryFO is the ISO 3166-1 alpha-2 code for // Faroe Islands. CountryFO Country = "FO" // CountryFR is the ISO 3166-1 alpha-2 code for // France. CountryFR Country = "FR" // CountryGA is the ISO 3166-1 alpha-2 code for // Gabon. CountryGA Country = "GA" // CountryGB is the ISO 3166-1 alpha-2 code for // United Kingdom of Great Britain and Northern Ireland. CountryGB Country = "GB" // CountryGD is the ISO 3166-1 alpha-2 code for // Grenada. CountryGD Country = "GD" // CountryGE is the ISO 3166-1 alpha-2 code for // Georgia. CountryGE Country = "GE" // CountryGF is the ISO 3166-1 alpha-2 code for // French Guiana. CountryGF Country = "GF" // CountryGG is the ISO 3166-1 alpha-2 code for // Guernsey. CountryGG Country = "GG" // CountryGH is the ISO 3166-1 alpha-2 code for // Ghana. CountryGH Country = "GH" // CountryGI is the ISO 3166-1 alpha-2 code for // Gibraltar. CountryGI Country = "GI" // CountryGL is the ISO 3166-1 alpha-2 code for // Greenland. CountryGL Country = "GL" // CountryGM is the ISO 3166-1 alpha-2 code for // Gambia. CountryGM Country = "GM" // CountryGN is the ISO 3166-1 alpha-2 code for // Guinea. CountryGN Country = "GN" // CountryGP is the ISO 3166-1 alpha-2 code for // Guadeloupe. CountryGP Country = "GP" // CountryGQ is the ISO 3166-1 alpha-2 code for // Equatorial Guinea. CountryGQ Country = "GQ" // CountryGR is the ISO 3166-1 alpha-2 code for // Greece. CountryGR Country = "GR" // CountryGS is the ISO 3166-1 alpha-2 code for // South Georgia and the South Sandwich Islands. CountryGS Country = "GS" // CountryGT is the ISO 3166-1 alpha-2 code for // Guatemala. CountryGT Country = "GT" // CountryGU is the ISO 3166-1 alpha-2 code for // Guam. CountryGU Country = "GU" // CountryGW is the ISO 3166-1 alpha-2 code for // Guinea-Bissau. CountryGW Country = "GW" // CountryGY is the ISO 3166-1 alpha-2 code for // Guyana. CountryGY Country = "GY" // CountryHK is the ISO 3166-1 alpha-2 code for // Hong Kong. CountryHK Country = "HK" // CountryHM is the ISO 3166-1 alpha-2 code for // Heard Island and McDonald Islands. CountryHM Country = "HM" // CountryHN is the ISO 3166-1 alpha-2 code for // Honduras. CountryHN Country = "HN" // CountryHR is the ISO 3166-1 alpha-2 code for // Croatia. CountryHR Country = "HR" // CountryHT is the ISO 3166-1 alpha-2 code for // Haiti. CountryHT Country = "HT" // CountryHU is the ISO 3166-1 alpha-2 code for // Hungary. CountryHU Country = "HU" // CountryID is the ISO 3166-1 alpha-2 code for // Indonesia. CountryID Country = "ID" // CountryIE is the ISO 3166-1 alpha-2 code for // Ireland. CountryIE Country = "IE" // CountryIL is the ISO 3166-1 alpha-2 code for // Israel. CountryIL Country = "IL" // CountryIM is the ISO 3166-1 alpha-2 code for // Isle of Man. CountryIM Country = "IM" // CountryIN is the ISO 3166-1 alpha-2 code for // India. CountryIN Country = "IN" // CountryIO is the ISO 3166-1 alpha-2 code for // British Indian Ocean Territory. CountryIO Country = "IO" // CountryIQ is the ISO 3166-1 alpha-2 code for // Iraq. CountryIQ Country = "IQ" // CountryIR is the ISO 3166-1 alpha-2 code for // Iran, Islamic Republic of. CountryIR Country = "IR" // CountryIS is the ISO 3166-1 alpha-2 code for // Iceland. CountryIS Country = "IS" // CountryIT is the ISO 3166-1 alpha-2 code for // Italy. CountryIT Country = "IT" // CountryJE is the ISO 3166-1 alpha-2 code for // Jersey. CountryJE Country = "JE" // CountryJM is the ISO 3166-1 alpha-2 code for // Jamaica. CountryJM Country = "JM" // CountryJO is the ISO 3166-1 alpha-2 code for // Jordan. CountryJO Country = "JO" // CountryJP is the ISO 3166-1 alpha-2 code for // Japan. CountryJP Country = "JP" // CountryKE is the ISO 3166-1 alpha-2 code for // Kenya. CountryKE Country = "KE" // CountryKG is the ISO 3166-1 alpha-2 code for // Kyrgyzstan. CountryKG Country = "KG" // CountryKH is the ISO 3166-1 alpha-2 code for // Cambodia. CountryKH Country = "KH" // CountryKI is the ISO 3166-1 alpha-2 code for // Kiribati. CountryKI Country = "KI" // CountryKM is the ISO 3166-1 alpha-2 code for // Comoros. CountryKM Country = "KM" // CountryKN is the ISO 3166-1 alpha-2 code for // Saint Kitts and Nevis. CountryKN Country = "KN" // CountryKP is the ISO 3166-1 alpha-2 code for // Korea, Democratic People's Republic of. CountryKP Country = "KP" // CountryKR is the ISO 3166-1 alpha-2 code for // Korea, Republic of. CountryKR Country = "KR" // CountryKW is the ISO 3166-1 alpha-2 code for // Kuwait. CountryKW Country = "KW" // CountryKY is the ISO 3166-1 alpha-2 code for // Cayman Islands. CountryKY Country = "KY" // CountryKZ is the ISO 3166-1 alpha-2 code for // Kazakhstan. CountryKZ Country = "KZ" // CountryLA is the ISO 3166-1 alpha-2 code for // Lao People's Democratic Republic. CountryLA Country = "LA" // CountryLB is the ISO 3166-1 alpha-2 code for // Lebanon. CountryLB Country = "LB" // CountryLC is the ISO 3166-1 alpha-2 code for // Saint Lucia. CountryLC Country = "LC" // CountryLI is the ISO 3166-1 alpha-2 code for // Liechtenstein. CountryLI Country = "LI" // CountryLK is the ISO 3166-1 alpha-2 code for // Sri Lanka. CountryLK Country = "LK" // CountryLR is the ISO 3166-1 alpha-2 code for // Liberia. CountryLR Country = "LR" // CountryLS is the ISO 3166-1 alpha-2 code for // Lesotho. CountryLS Country = "LS" // CountryLT is the ISO 3166-1 alpha-2 code for // Lithuania. CountryLT Country = "LT" // CountryLU is the ISO 3166-1 alpha-2 code for // Luxembourg. CountryLU Country = "LU" // CountryLV is the ISO 3166-1 alpha-2 code for // Latvia. CountryLV Country = "LV" // CountryLY is the ISO 3166-1 alpha-2 code for // Libya. CountryLY Country = "LY" // CountryMA is the ISO 3166-1 alpha-2 code for // Morocco. CountryMA Country = "MA" // CountryMC is the ISO 3166-1 alpha-2 code for // Monaco. CountryMC Country = "MC" // CountryMD is the ISO 3166-1 alpha-2 code for // Moldova, Republic of. CountryMD Country = "MD" // CountryME is the ISO 3166-1 alpha-2 code for // Montenegro. CountryME Country = "ME" // CountryMF is the ISO 3166-1 alpha-2 code for // Saint Martin (French part). CountryMF Country = "MF" // CountryMG is the ISO 3166-1 alpha-2 code for // Madagascar. CountryMG Country = "MG" // CountryMH is the ISO 3166-1 alpha-2 code for // Marshall Islands. CountryMH Country = "MH" // CountryMK is the ISO 3166-1 alpha-2 code for // North Macedonia. CountryMK Country = "MK" // CountryML is the ISO 3166-1 alpha-2 code for // Mali. CountryML Country = "ML" // CountryMM is the ISO 3166-1 alpha-2 code for // Myanmar. CountryMM Country = "MM" // CountryMN is the ISO 3166-1 alpha-2 code for // Mongolia. CountryMN Country = "MN" // CountryMO is the ISO 3166-1 alpha-2 code for // Macao. CountryMO Country = "MO" // CountryMP is the ISO 3166-1 alpha-2 code for // Northern Mariana Islands. CountryMP Country = "MP" // CountryMQ is the ISO 3166-1 alpha-2 code for // Martinique. CountryMQ Country = "MQ" // CountryMR is the ISO 3166-1 alpha-2 code for // Mauritania. CountryMR Country = "MR" // CountryMS is the ISO 3166-1 alpha-2 code for // Montserrat. CountryMS Country = "MS" // CountryMT is the ISO 3166-1 alpha-2 code for // Malta. CountryMT Country = "MT" // CountryMU is the ISO 3166-1 alpha-2 code for // Mauritius. CountryMU Country = "MU" // CountryMV is the ISO 3166-1 alpha-2 code for // Maldives. CountryMV Country = "MV" // CountryMW is the ISO 3166-1 alpha-2 code for // Malawi. CountryMW Country = "MW" // CountryMX is the ISO 3166-1 alpha-2 code for // Mexico. CountryMX Country = "MX" // CountryMY is the ISO 3166-1 alpha-2 code for // Malaysia. CountryMY Country = "MY" // CountryMZ is the ISO 3166-1 alpha-2 code for // Mozambique. CountryMZ Country = "MZ" // CountryNA is the ISO 3166-1 alpha-2 code for // Namibia. CountryNA Country = "NA" // CountryNC is the ISO 3166-1 alpha-2 code for // New Caledonia. CountryNC Country = "NC" // CountryNE is the ISO 3166-1 alpha-2 code for // Niger. CountryNE Country = "NE" // CountryNF is the ISO 3166-1 alpha-2 code for // Norfolk Island. CountryNF Country = "NF" // CountryNG is the ISO 3166-1 alpha-2 code for // Nigeria. CountryNG Country = "NG" // CountryNI is the ISO 3166-1 alpha-2 code for // Nicaragua. CountryNI Country = "NI" // CountryNL is the ISO 3166-1 alpha-2 code for // Netherlands, Kingdom of the. CountryNL Country = "NL" // CountryNO is the ISO 3166-1 alpha-2 code for // Norway. CountryNO Country = "NO" // CountryNP is the ISO 3166-1 alpha-2 code for // Nepal. CountryNP Country = "NP" // CountryNR is the ISO 3166-1 alpha-2 code for // Nauru. CountryNR Country = "NR" // CountryNU is the ISO 3166-1 alpha-2 code for // Niue. CountryNU Country = "NU" // CountryNZ is the ISO 3166-1 alpha-2 code for // New Zealand. CountryNZ Country = "NZ" // CountryOM is the ISO 3166-1 alpha-2 code for // Oman. CountryOM Country = "OM" // CountryPA is the ISO 3166-1 alpha-2 code for // Panama. CountryPA Country = "PA" // CountryPE is the ISO 3166-1 alpha-2 code for // Peru. CountryPE Country = "PE" // CountryPF is the ISO 3166-1 alpha-2 code for // French Polynesia. CountryPF Country = "PF" // CountryPG is the ISO 3166-1 alpha-2 code for // Papua New Guinea. CountryPG Country = "PG" // CountryPH is the ISO 3166-1 alpha-2 code for // Philippines. CountryPH Country = "PH" // CountryPK is the ISO 3166-1 alpha-2 code for // Pakistan. CountryPK Country = "PK" // CountryPL is the ISO 3166-1 alpha-2 code for // Poland. CountryPL Country = "PL" // CountryPM is the ISO 3166-1 alpha-2 code for // Saint Pierre and Miquelon. CountryPM Country = "PM" // CountryPN is the ISO 3166-1 alpha-2 code for // Pitcairn. CountryPN Country = "PN" // CountryPR is the ISO 3166-1 alpha-2 code for // Puerto Rico. CountryPR Country = "PR" // CountryPS is the ISO 3166-1 alpha-2 code for // Palestine, State of. CountryPS Country = "PS" // CountryPT is the ISO 3166-1 alpha-2 code for // Portugal. CountryPT Country = "PT" // CountryPW is the ISO 3166-1 alpha-2 code for // Palau. CountryPW Country = "PW" // CountryPY is the ISO 3166-1 alpha-2 code for // Paraguay. CountryPY Country = "PY" // CountryQA is the ISO 3166-1 alpha-2 code for // Qatar. CountryQA Country = "QA" // CountryRE is the ISO 3166-1 alpha-2 code for // Réunion. CountryRE Country = "RE" // CountryRO is the ISO 3166-1 alpha-2 code for // Romania. CountryRO Country = "RO" // CountryRS is the ISO 3166-1 alpha-2 code for // Serbia. CountryRS Country = "RS" // CountryRU is the ISO 3166-1 alpha-2 code for // Russian Federation. CountryRU Country = "RU" // CountryRW is the ISO 3166-1 alpha-2 code for // Rwanda. CountryRW Country = "RW" // CountrySA is the ISO 3166-1 alpha-2 code for // Saudi Arabia. CountrySA Country = "SA" // CountrySB is the ISO 3166-1 alpha-2 code for // Solomon Islands. CountrySB Country = "SB" // CountrySC is the ISO 3166-1 alpha-2 code for // Seychelles. CountrySC Country = "SC" // CountrySD is the ISO 3166-1 alpha-2 code for // Sudan. CountrySD Country = "SD" // CountrySE is the ISO 3166-1 alpha-2 code for // Sweden. CountrySE Country = "SE" // CountrySG is the ISO 3166-1 alpha-2 code for // Singapore. CountrySG Country = "SG" // CountrySH is the ISO 3166-1 alpha-2 code for // Saint Helena, Ascension and Tristan da Cunha. CountrySH Country = "SH" // CountrySI is the ISO 3166-1 alpha-2 code for // Slovenia. CountrySI Country = "SI" // CountrySJ is the ISO 3166-1 alpha-2 code for // Svalbard and Jan Mayen. CountrySJ Country = "SJ" // CountrySK is the ISO 3166-1 alpha-2 code for // Slovakia. CountrySK Country = "SK" // CountrySL is the ISO 3166-1 alpha-2 code for // Sierra Leone. CountrySL Country = "SL" // CountrySM is the ISO 3166-1 alpha-2 code for // San Marino. CountrySM Country = "SM" // CountrySN is the ISO 3166-1 alpha-2 code for // Senegal. CountrySN Country = "SN" // CountrySO is the ISO 3166-1 alpha-2 code for // Somalia. CountrySO Country = "SO" // CountrySR is the ISO 3166-1 alpha-2 code for // Suriname. CountrySR Country = "SR" // CountrySS is the ISO 3166-1 alpha-2 code for // South Sudan. CountrySS Country = "SS" // CountryST is the ISO 3166-1 alpha-2 code for // Sao Tome and Principe. CountryST Country = "ST" // CountrySV is the ISO 3166-1 alpha-2 code for // El Salvador. CountrySV Country = "SV" // CountrySX is the ISO 3166-1 alpha-2 code for // Sint Maarten (Dutch part). CountrySX Country = "SX" // CountrySY is the ISO 3166-1 alpha-2 code for // Syrian Arab Republic. CountrySY Country = "SY" // CountrySZ is the ISO 3166-1 alpha-2 code for // Eswatini. CountrySZ Country = "SZ" // CountryTC is the ISO 3166-1 alpha-2 code for // Turks and Caicos Islands. CountryTC Country = "TC" // CountryTD is the ISO 3166-1 alpha-2 code for // Chad. CountryTD Country = "TD" // CountryTF is the ISO 3166-1 alpha-2 code for // French Southern Territories. CountryTF Country = "TF" // CountryTG is the ISO 3166-1 alpha-2 code for // Togo. CountryTG Country = "TG" // CountryTH is the ISO 3166-1 alpha-2 code for // Thailand. CountryTH Country = "TH" // CountryTJ is the ISO 3166-1 alpha-2 code for // Tajikistan. CountryTJ Country = "TJ" // CountryTK is the ISO 3166-1 alpha-2 code for // Tokelau. CountryTK Country = "TK" // CountryTL is the ISO 3166-1 alpha-2 code for // Timor-Leste. CountryTL Country = "TL" // CountryTM is the ISO 3166-1 alpha-2 code for // Turkmenistan. CountryTM Country = "TM" // CountryTN is the ISO 3166-1 alpha-2 code for // Tunisia. CountryTN Country = "TN" // CountryTO is the ISO 3166-1 alpha-2 code for // Tonga. CountryTO Country = "TO" // CountryTR is the ISO 3166-1 alpha-2 code for // Türkiye. CountryTR Country = "TR" // CountryTT is the ISO 3166-1 alpha-2 code for // Trinidad and Tobago. CountryTT Country = "TT" // CountryTV is the ISO 3166-1 alpha-2 code for // Tuvalu. CountryTV Country = "TV" // CountryTW is the ISO 3166-1 alpha-2 code for // Taiwan, Province of China. CountryTW Country = "TW" // CountryTZ is the ISO 3166-1 alpha-2 code for // Tanzania, United Republic of. CountryTZ Country = "TZ" // CountryUA is the ISO 3166-1 alpha-2 code for // Ukraine. CountryUA Country = "UA" // CountryUG is the ISO 3166-1 alpha-2 code for // Uganda. CountryUG Country = "UG" // CountryUM is the ISO 3166-1 alpha-2 code for // United States Minor Outlying Islands. CountryUM Country = "UM" // CountryUS is the ISO 3166-1 alpha-2 code for // United States of America. CountryUS Country = "US" // CountryUY is the ISO 3166-1 alpha-2 code for // Uruguay. CountryUY Country = "UY" // CountryUZ is the ISO 3166-1 alpha-2 code for // Uzbekistan. CountryUZ Country = "UZ" // CountryVA is the ISO 3166-1 alpha-2 code for // Holy See. CountryVA Country = "VA" // CountryVC is the ISO 3166-1 alpha-2 code for // Saint Vincent and the Grenadines. CountryVC Country = "VC" // CountryVE is the ISO 3166-1 alpha-2 code for // Venezuela, Bolivarian Republic of. CountryVE Country = "VE" // CountryVG is the ISO 3166-1 alpha-2 code for // Virgin Islands (British). CountryVG Country = "VG" // CountryVI is the ISO 3166-1 alpha-2 code for // Virgin Islands (U.S.). CountryVI Country = "VI" // CountryVN is the ISO 3166-1 alpha-2 code for // Viet Nam. CountryVN Country = "VN" // CountryVU is the ISO 3166-1 alpha-2 code for // Vanuatu. CountryVU Country = "VU" // CountryWF is the ISO 3166-1 alpha-2 code for // Wallis and Futuna. CountryWF Country = "WF" // CountryWS is the ISO 3166-1 alpha-2 code for // Samoa. CountryWS Country = "WS" // CountryYE is the ISO 3166-1 alpha-2 code for // Yemen. CountryYE Country = "YE" // CountryYT is the ISO 3166-1 alpha-2 code for // Mayotte. CountryYT Country = "YT" // CountryZA is the ISO 3166-1 alpha-2 code for // South Africa. CountryZA Country = "ZA" // CountryZM is the ISO 3166-1 alpha-2 code for // Zambia. CountryZM Country = "ZM" // CountryZW is the ISO 3166-1 alpha-2 code for // Zimbabwe. CountryZW Country = "ZW" )
Country code constants. Note that these constants don't include the user-assigned ones.
func NewCountry ¶
NewCountry converts s into a Country while also validating it. Prefer to use this instead of a plain conversion.
func (*Country) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for *Country.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a file implementation of geoip.Interface. It should be initially refreshed before use.
func NewFile ¶
func NewFile(c *FileConfig) (f *File)
NewFile returns a new GeoIP database that reads information from a file. It also adds the caches with IDs [CacheIDIP] and [CacheIDHost] to the cache manager.
func (*File) Data ¶
Data implements the Interface interface for *File. If ip is netip.Addr{}, Data tries to lookup and return the data based on host, unless it's empty.
func (*File) Refresh ¶
Refresh implements the [agdservice.Refresher] interface for *File. It reopens the GeoIP database files.
func (*File) SubnetByLocation ¶
SubnetByLocation implements the Interface interface for *File. fam must be either netutil.AddrFamilyIPv4 or netutil.AddrFamilyIPv6. l must not be nil.
The process of the subnet selection is as follows:
A list of the most common ASNs, including the top ASN for each country, is pre-generated from the statistics data. See file asntops_generate.go and its output, asntops.go.
During the server startup, File scans through the provided GeoIP database files searching for the fitting subnets for ASNs and countries. See [resetCountrySubnets] and [File.resetLocationSubnets].
If asn is found within the list of the most used ASNs, its subnet is returned. If not, the top ASN for the provided country is chosen and its subnet is returned. If the information about the most used ASNs is not available, the first subnet from the country that is broad enough (see resetCountrySubnets) is chosen.
type FileConfig ¶
type FileConfig struct { // Logger is used for logging the operation of the file-based GeoIP // database. Logger *slog.Logger // CacheManager is the global cache manager. CacheManager must not be nil. CacheManager agdcache.Manager // AllTopASNs contains all subnets from CountryTopASNs. While scanning the // statistics data file this set is used to check if the current ASN // included in CountryTopASNs. AllTopASNs *container.MapSet[ASN] // CountryTopASNs is a mapping of a country to their top ASNs. CountryTopASNs map[Country]ASN // ASNPath is the path to the GeoIP database of ASNs. ASNPath string // CountryPath is the path to the GeoIP database of countries. The // databases containing subdivisions and cities info are also supported. CountryPath string // HostCacheSize is how many lookups are cached by hostname. Zero means no // host caching is performed. HostCacheSize int // IPCacheSize is how many lookups are cached by IP address. IPCacheSize int }
FileConfig is the file-based GeoIP configuration structure.
type Interface ¶
type Interface interface { // SubnetByLocation returns the default subnet for location, if there is // one. If there isn't, n is an unspecified subnet. fam must be either // [netutil.AddrFamilyIPv4] or [netutil.AddrFamilyIPv6]. SubnetByLocation(l *Location, fam netutil.AddrFamily) (n netip.Prefix, err error) // Data returns the GeoIP data for ip. It may use host to get cached GeoIP // data if ip is netip.Addr{}. Data(host string, ip netip.Addr) (l *Location, err error) }
Interface is the interface for the GeoIP database that stores the geographic data about an IP address.
type Location ¶
type Location struct { // Country is the country whose subnets contain the IP address. Country Country // Continent is the continent whose subnets contain the IP address. Continent Continent // TopSubdivision is the ISO-code of the political subdivision of a country // whose subnets contain the IP address. This field may be empty. TopSubdivision string // ASN is the number of the autonomous system whose subnets contain the IP // address. ASN ASN }
Location represents the GeoIP location data about an IP address.
type NotAContinentError ¶
type NotAContinentError struct { // Code is the code presented to NewContinent. Code string }
NotAContinentError is returned from NewContinent when the string doesn't represent a valid continent.
func (*NotAContinentError) Error ¶
func (err *NotAContinentError) Error() (msg string)
Error implements the error interface for *NotAContinentError.
type NotACountryError ¶
type NotACountryError struct { // Code is the code presented to NewCountry. Code string }
NotACountryError is returned from NewCountry when the string doesn't represent a valid country.
func (*NotACountryError) Error ¶
func (err *NotACountryError) Error() (msg string)
Error implements the error interface for *NotACountryError.