diff --git a/cache.go b/cache.go index 6bd54ff..64cf20a 100644 --- a/cache.go +++ b/cache.go @@ -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.