cache

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package cache handles local file caching for subscription data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear() error

Clear removes cache file.

func Info

func Info() string

Info returns the cache file path for debugging.

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.

Types

type MembershipCache

type MembershipCache struct {
	CachedAt string          `json:"cached_at"`
	Data     json.RawMessage `json:"data"`
}

MembershipCache wraps subscription data with a timestamp.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL