Versions in this module Expand all Collapse all v1 v1.1.0 Aug 25, 2025 v1.0.0 Aug 21, 2025 Changes in this version + type CacheEntry struct + Data []byte + ETag string + ExpiresAt time.Time + type CachedHTTPClient struct + func NewCachedHTTPClient(cache *OtterCache, httpClient HTTPClient, logger *slog.Logger) *CachedHTTPClient + func (c *CachedHTTPClient) Do(ctx context.Context, req *http.Request) (*http.Response, error) + type HTTPClient interface + Do func(req *http.Request) (*http.Response, error) + type OtterCache struct + func NewMemoryOnlyCache(ttl time.Duration, logger *slog.Logger) (*OtterCache, error) + func NewOtterCache(ctx context.Context, dir string, ttl time.Duration, logger *slog.Logger) (*OtterCache, error) + func (c *OtterCache) APICall(url string, requestBody []byte) ([]byte, bool) + func (c *OtterCache) Close() error + func (c *OtterCache) Get(url string) (data []byte, etag string, found bool) + func (c *OtterCache) Set(url string, data []byte, etag string) error + func (c *OtterCache) SetAPICall(url string, requestBody []byte, data []byte) error + func (c *OtterCache) Stats() map[string]any