Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(geoip Interface) mux.MiddlewareFunc
Types ¶
type Config ¶
type Config struct {
DB string `json:"db" usage:"path of the Maxmind GeoIP2Country database"`
}
Config contains the set of configuration options needed to configure looking up a users location.
type Empty ¶
type Empty struct{}
Empty provides an implementation that always returns empty information, regardless of ip.
type Info ¶
type Info struct {
CountryCode string
}
Info describes the various pieces of information that can be returned from a lookup.
type Maxmind ¶
type Maxmind struct {
// contains filtered or unexported fields
}
Maxmind provides logic for using Maxmind to resolve country information.
func CountryLite ¶
CountryLite uses the Maxmind GeoIP Country Lite database to resolve IP addresses to their associated country info.
Click to show internal directories.
Click to hide internal directories.