File: README.textile

package info (click to toggle)
golang-libgeoip 0.0~git20140312.0.c78e8bd-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 68 kB
  • sloc: makefile: 7
file content (46 lines) | stat: -rw-r--r-- 1,320 bytes parent folder | download | duplicates (2)
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
h2. General Description

p{width:500px}. This is the Go implementation of the "Maxmind":http://www.maxmind.com/app/ip-location GeoIP API. It is incomplete and work in progress the initial goal is support only two of the database types - the City Lite and Country Lite. The only supported method is loading the full db on startup into memory (memory cache).

h3. Supported Access Methods

* In Memory (Load(string))

h3. Supported Database Formats

* Country Edition    (dbType=1)
* City Edition REV 0 (dbType=6)
* City Edition REV 1 (dbType=2)

h3. Supported Lookups

* By IP Address (GetLocationByIP(string))
* By IP Number  (GetLocationByIPNum(uint32))

h3. Supported Responses

* CountryCode string (available in all databases)
* CountryName string (available in all databases)
* City string
* Region string
* PostalCode string
* Latitude float32
* Longitude float32

h3. To Do
* Implement better error handling (report the error on load and lookups)
* Better returns, country edition has only code and name (perhaps use interfaces)
* Add test cases and benchmarking
* Add support for more database formats

h3. Build

make (See Makefile for more details)

h3. Example

./example DBFILE IPADDRESS (i.e. ./example GeoIP.dat 1.1.1.1)

h3. Usage

Please see example.go for a complete example of how to use this library.