Documentation ¶
Index ¶
Constants ¶
View Source
const (
CacheSize = 50000
)
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 ¶
NewServer constructs a new GeoServer using the (optional) uncompressed dbFile. If dbFile is "", then this will fetch the latest GeoLite2-City database from the specified DBURL
func (*GeoServer) Handle ¶
func (server *GeoServer) Handle(resp http.ResponseWriter, req *http.Request, basePath string, allowOrigin 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. allowOrigin is the cors response config, if not empty it is written to the response header.
Click to show internal directories.
Click to hide internal directories.