Documentation
¶
Overview ¶
Package cache handles local file caching for subscription data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(ttl time.Duration) (json.RawMessage, error)
Load reads cache file, returns nil if not exists or expired.
func Save ¶
func Save(data json.RawMessage) error
Save writes cache file atomically via a temporary file + rename.
Types ¶
type MembershipCache ¶
type MembershipCache struct {
CachedAt string `json:"cached_at"`
Data json.RawMessage `json:"data"`
}
MembershipCache wraps subscription data with a timestamp.
Click to show internal directories.
Click to hide internal directories.