Files
boot-dev-pokedex/pokeapi/client.go
2025-03-10 22:20:51 +02:00

24 lines
381 B
Go

package pokeapi
import (
"github.com/rdarius/boot-dev-pokedex/pokecache"
"net/http"
"time"
)
// Client -
type Client struct {
cache pokecache.Cache
httpClient http.Client
}
// NewClient -
func NewClient(timeout, cacheInterval time.Duration) Client {
return Client{
cache: pokecache.NewCache(cacheInterval),
httpClient: http.Client{
Timeout: timeout,
},
}
}