Replies: 1 comment
-
I think that the current behavior of Set(key, value, 0) // persist
Set(key, value, -1) // keep ttl
Set(key, value, time.Minute) // ttl It is as simple as it can be and that is good. It does not support EXAT|PXAT, but it is fine. As an idea we can also consider the following rdb := redis.NewClient(...)
rdb.SetCmd(key, value).TTL(time.Minute).Exec()
rdb.SetCmd(key, value).KeepTTL().Exec()
rdb.SetCmd(key, value).ExpireAt(time.Now()).Exec()
type SetCmd struct {
key string
value string
ttl time.Duration
expireAt time.Time
} But TBH I think we should continue doing what we currently do by providing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Many commands have expiration time parameters:
I have two thoughts:
OR:
have a better idea?
Beta Was this translation helpful? Give feedback.
All reactions