mmdb

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

README

Go package for downloading MaxMind GeoLite2 database

GoDoc Build Status

Functions in this package are downloading MaxMind Geolite2 tar archives, extracting the database file from it to a provided file name, and saving MD5 sum of tar archive in a file in the same directory as the database file. MD5 sum is used for checking if the database is updated on the next function call.

Installation

go get resenje.org/mmdb

Documentation

Overview

Package mmdb is a Go library for downloading and updating MaxMind GeoLite2 databases.

Functions will download tar archive, extract the database file from it to a provided file name, and save MD5 sum of tar archive in a file in the same directory as the database file. MD5 sum is used for checking if the database is updated on the next function call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateGeoLite2ASN

func UpdateGeoLite2ASN(ctx context.Context, filename string) (saved bool, err error)

UpdateGeoLite2ASN downloads and updates a GeoLite2 ASN database and saves it under filename. MD5 sum of the tar archive is saved in a file in the same directory for update checks.

func UpdateGeoLite2City

func UpdateGeoLite2City(ctx context.Context, filename string) (saved bool, err error)

UpdateGeoLite2City downloads and updates a GeoLite2 City database and saves it under filename. MD5 sum of the tar archive is saved in a file in the same directory for update checks.

func UpdateGeoLite2Country

func UpdateGeoLite2Country(ctx context.Context, filename string) (saved bool, err error)

UpdateGeoLite2Country downloads and updates a GeoLite2 Country database and saves it under filename. MD5 sum of the tar archive is saved in a file in the same directory for update checks.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL