Documentation
¶
Overview ¶
Package cache provides file-based caching with TTL expiry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CachedEligibilityLister ¶
type CachedEligibilityLister struct {
// contains filtered or unexported fields
}
CachedEligibilityLister decorates eligibility listers with file-based caching. It implements both EligibilityLister and GroupsEligibilityLister.
func NewCachedEligibilityLister ¶
func NewCachedEligibilityLister( cloudInner EligibilityLister, groupsInner GroupsEligibilityLister, store *Store, refresh bool, log Logger, ) *CachedEligibilityLister
NewCachedEligibilityLister creates a new caching decorator. Either inner may be nil if that type of listing is not needed. When refresh is true, the cache read is bypassed but the API response is still cached. Logger is optional — pass nil for silent operation.
func (*CachedEligibilityLister) ListEligibility ¶
func (c *CachedEligibilityLister) ListEligibility(ctx context.Context, csp models.CSP) (*models.EligibilityResponse, error)
ListEligibility checks the cache first, then falls through to the inner lister.
func (*CachedEligibilityLister) ListGroupsEligibility ¶
func (c *CachedEligibilityLister) ListGroupsEligibility(ctx context.Context, csp models.CSP) (*models.GroupsEligibilityResponse, error)
ListGroupsEligibility checks the cache first, then falls through to the inner lister.
type EligibilityLister ¶
type EligibilityLister interface {
ListEligibility(ctx context.Context, csp models.CSP) (*models.EligibilityResponse, error)
}
EligibilityLister mirrors cmd.eligibilityLister to avoid import cycles.
type GroupsEligibilityLister ¶
type GroupsEligibilityLister interface {
ListGroupsEligibility(ctx context.Context, csp models.CSP) (*models.GroupsEligibilityResponse, error)
}
GroupsEligibilityLister mirrors cmd.groupsEligibilityLister to avoid import cycles.