Add caching to minimize lookup time (closes #12)

This commit is contained in:
Tom Neuber 2024-02-26 09:40:34 +01:00
parent 177f378715
commit ec76d2b728
3 changed files with 47 additions and 10 deletions

View file

@ -32,6 +32,9 @@ func main() {
}
fmt.Println("Import data from file successful")
geoloc.IPCache = geoloc.NewCache()
fmt.Println("Cache created")
r := chi.NewRouter()
r.Use(middleware.RequestID)
r.Use(middleware.Logger)