<commit_before>package geoserve

import (
	"compress/gzip"
	"encoding/json"
	"fmt"
	geoip2 "github.com/oschwald/geoip2-golang"
	"io/ioutil"
	"log"
	"net"
	"net/http"
	"os"
	"strings"
	"time"
)

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

// GeoServer is a server for IP geolocation information
type GeoServer struct {
	db       *geoip2.Reader
	dbDate   time.Time
	cache    map[string][]byte // TODO: bound the cache
	cacheGet chan get
	dbUpdate chan dbu
}

// get encapsulates a request to geolocate an ip address
type get struct {
	ip   string
	resp chan []byte
}

// dbu encapsulates an update to the MaxMind database
type dbu struct {
	db     *geoip2.Reader<commit_msg>Experimenting with heroku build<commit_after>package geoserve

import (
	"compress/gzip"
	"encoding/json"
	"fmt"
	//geoip2 "github.com/oschwald/geoip2-golang"
	"io/ioutil"
	"log"
	"net"
	"net/http"
	"os"
	"strings"
	"time"
)

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

// GeoServer is a server for IP geolocation information
type GeoServer struct {
	db       *geoip2.Reader
	dbDate   time.Time
	cache    map[string][]byte // TODO: bound the cache
	cacheGet chan get
	dbUpdate chan dbu
}

// get encapsulates a request to geolocate an ip address
type get struct {
	ip   string
	resp chan []byte
}

// dbu encapsulates an update to the MaxMind database
type dbu struct {
	db     *geoip2.Reader
{'fraction_non_alphanumeric': 0.10612244897959183, 'fraction_numerical': 0.006802721088435374, 'mean_word_length': 3.5122699386503067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1834911', 'n_tokens_mistral': 578, 'n_tokens_neox': 553, 'n_words': 152}