Versions in this module Expand all Collapse all v1 v1.0.1 Feb 21, 2024 v1.0.0 Feb 21, 2024 Changes in this version + const ErrNotFound + type AutoRefresh interface + DeleteDelayed func(id ItemID) error + Get func(id ItemID) (Item, error) + GetOrCreate func(id ItemID, item Item) (Item, error) + Start func(ctx context.Context) error + func NewAutoRefreshBatchedCache(name string, createBatches CreateBatchesFunc, syncCb SyncFunc, ...) (AutoRefresh, error) + func NewAutoRefreshCache(name string, syncCb SyncFunc, syncRateLimiter workqueue.RateLimiter, ...) (AutoRefresh, error) + type Batch = []ItemWrapper + func SingleItemBatches(_ context.Context, snapshot []ItemWrapper) (batches []Batch, err error) + type CreateBatchesFunc func(ctx context.Context, snapshot []ItemWrapper) (batches []Batch, err error) + type Item interface + IsTerminal func() bool + type ItemID = string + type ItemSyncResponse struct + Action SyncAction + ID ItemID + Item Item + type ItemWrapper interface + GetID func() ItemID + GetItem func() Item + type SyncAction int + const Unchanged + const Update + type SyncFunc func(ctx context.Context, batch Batch) (updatedBatch []ItemSyncResponse, err error)