Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ func WithExpiration(exp time.Duration) ItemOption {
}
}

// WithExpirationDeadline is an option to set expiration deadline for any items.
func WithExpirationDeadline(deadline time.Time) ItemOption {
return func(o *itemOptions) {
o.expiration = deadline
}
}

// WithReferenceCount is an option to set reference count for any items.
// This option is only applicable to cache policies that have a reference count (e.g., Clock, LFU).
// referenceCount specifies the reference count value to set for the cache item.
Expand Down