Implement response cache

This commit is contained in:
Martin Polden
2019-12-25 21:04:26 +01:00
parent 66719b9932
commit 78116f69ad
6 changed files with 111 additions and 8 deletions

View File

@ -31,7 +31,7 @@ func (t *testDb) ASN(net.IP) (geo.ASN, error) {
func (t *testDb) IsEmpty() bool { return false }
func testServer() *Server {
return &Server{gr: &testDb{}, LookupAddr: lookupAddr, LookupPort: lookupPort}
return &Server{cache: NewCache(100), gr: &testDb{}, LookupAddr: lookupAddr, LookupPort: lookupPort}
}
func httpGet(url string, acceptMediaType string, userAgent string) (string, int, error) {