Documentation
¶
Overview ¶
Package status provides a cache for the MarketData API status endpoint, used to avoid retrying requests when the service is known to be offline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache tracks the API's online/offline status for use in retry decisions. It is safe for concurrent use.
func (*Cache) IsOnline ¶
IsOnline returns whether the API is currently considered online. It applies the caching strategy with 270s/300s thresholds:
- Cached offline: always re-probe immediately (see below), return false until a probe succeeds.
- Cache age < 270s: return cached status.
- Cache age 270s-300s: return cached status, trigger non-blocking refresh.
- Cache age >= 300s or empty: return unknown (true), trigger non-blocking refresh.
Click to show internal directories.
Click to hide internal directories.