File: README.md

package info (click to toggle)
lua-geoip 0.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 244 kB
  • sloc: ansic: 765; makefile: 10; sh: 10
file content (66 lines) | stat: -rw-r--r-- 1,333 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
lua-geoip — bindings for MaxMind GeoIP library
==============================================

See the copyright information in the file named `COPYRIGHT`.

## API

* `require 'geoip'`

### Enums

#### DB types

* `geoip.COUNTRY`
* `geoip.COUNTRY_V6`
* `geoip.REGION_REV0`
* `geoip.REGION_REV1`
* `geoip.REGION` = `geoip.REGION_REV1`
* `geoip.CITY_REV0`
* `geoip.CITY_REV1`
* `geoip.CITY` = `geoip.CITY_REV1`
* `geoip.ORG`
* `geoip.ISP`
* `geoip.PROXY`
* `geoip.ASNUM`
* `geoip.NETSPEED`
* `geoip.DOMAIN`

#### Open flags

* `geoip.STANDARD`
* `geoip.MEMORY_CACHE`
* `geoip.CHECK_CACHE`
* `geoip.INDEX_CACHE`
* `geoip.MMAP_CACHE`

#### Charsets

* `geoip.ISO_8859_1`
* `geoip.UTF8`

TODO: Document further. Meanwhile, see tests.

## Where to get stuff?

### On Debian / Ubuntu Using PPA:

MaxMind provides a PPA for recent version of Ubuntu. To add the PPA to your
APT sources, run:

    $ sudo add-apt-repository ppa:maxmind/ppa
    $ sudo apt-get update

Then install the packages by running:

    $ sudo apt-get install geoip-database # GeoLite Country only
    $ sudo apt-get install libgeoip-dev

### Raw

    $ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
    $ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

### C library

    http://www.maxmind.com/app/c