refactor: split jikan client into transport/cache/rate subpackages

This commit is contained in:
2026-06-16 00:50:12 +02:00
committed by Milas Holsting
parent 4f73b0ca97
commit 9e25745804
6 changed files with 477 additions and 373 deletions

View File

@@ -31,7 +31,7 @@ func TestGetWithCacheReturnsStaleAndRefreshesAsync(t *testing.T) {
stale := TopAnimeResponse{Data: []Anime{{MalID: 1, Title: "stale"}}}
insertCachedResponse(t, sqlDB, "top:1", stale, time.Now().Add(-time.Hour))
client.httpClient = &http.Client{
client.fetcher.HTTPClient = &http.Client{
Transport: roundTripFunc(func(*http.Request) (*http.Response, error) {
body := `{"data":[{"mal_id":2,"title":"fresh"}]}`
return &http.Response{