geoserve

package
v0.0.0-...-58ccc00 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB_URL = "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoServer

type GeoServer struct {
	// contains filtered or unexported fields
}

GeoServer is a server for IP geolocation information

func NewServer

func NewServer(dbFile string) (server *GeoServer, err error)

NewServer constructs a new GeoServer using the (optional) uncompressed dbFile. If dbFile is "", then this will fetch the latest GeoLite2-City database from MaxMind's website.

func (*GeoServer) Handle

func (server *GeoServer) Handle(resp http.ResponseWriter, req *http.Request, basePath string)

Handle is used to handle requests from an HTTP server. basePath is the path at which the containing request handler is registered, and is used to extract the ip address from the remainder of the path.

Jump to

Keyboard shortcuts

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