The resulting lookup data from you query. The IPv4 address or IPv6 address you are querying, as a string. Gets all the information available on the provided IP. Resolves when finished, if any error occurs it rejects. geoliteDB.update()įorces an update on the PostgreSQL database using the options provided in geolite.init. Promise that contains the object used for all future API calls. (string) geolite_asn_ipv6: direct download link or filepath for the GeoLite ASN database in CSV / zip format.(string) geolite_asn: direct download link or filepath for the GeoLite ASN database in CSV / zip format.(string) geolite2_city: direct download link or filepath for the GeoLite2 City database in CSV format, zipped. (boolean) local: if set to true, the resources below are interpreted as filepaths and decompressed to the location specified above.(boolean) cleanup: the location folder above will be created if it doesn't exist, if cleanup is set to true it will delete the location folder once it is no longer necessary.(string) location: relative or absolute path to where the GeoLite databases get downloaded (if local is false) and decompressed to.Takes the configuration object from pg-promise with most of the properties. If the options provided don't get properly validated by Joi, then an error is returned and can be caught via the reject promise. Otherwise, it updates the PostgreSQL database using the options provided. If the database is ready, it returns the geoliteDB object in the promise. Install $ npm install -save postgres-geoliteĬhecks whether the database in PostgreSQL has been initialized, and validates the schema with the current version of this module. This is the for the build process only, if you plan on building & updating a different machine you can still utilize this on a machine with less RAM.Otherwise if you have ideas on doing this feel free to contact me to discuss. If you are able to do this, feel free to fork and submit a PR. Unfortunately I was unable to figure out how to best map the geoname ID data in the database to allow for geoname_ids on each location type (continent, country, subdivisions, city). I had originally wanted to return the data similar to the node-maxmind project, thus allowing this module to server as a drop-in replacement. This module is designed to import the GeoIP2 and Geolite Legacy database CSVs into a PostgreSQL database and query it efficiently and effectively. MaxMind Geolite PostgreSQL importer & interface to provide IPv4 and IPv6 lookups for country, subdivisions, city, timezone, area code, ISP, etc.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |