Skip to content

Commit f1e7f04

Browse files
committed
add ttl to cache
1 parent 267289b commit f1e7f04

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cache/common.go

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package cache
22

3+
import "time"
4+
35
type TCache[K comparable, T interface{}] interface {
46
Has(key K) bool
57
Get(key K) (T, bool)
68
Set(key K, value T)
9+
SetWithTTL(key K, value T, ttl time.Time)
710
Del(key K)
811
Keys() []K
912
Flush()

0 commit comments

Comments
 (0)