jihuayu commented on code in PR #1935:
URL: https://github.com/apache/kvrocks/pull/1935#discussion_r1428951918
##########
src/types/redis_string.cc:
##########
@@ -217,38 +206,87 @@ rocksdb::Status String::Set(const std::string &user_key,
const std::string &valu
return MSet(pairs, /*ttl=*/0, /*lock=*/true);
}
-rocksdb::Status String::SetEX(const std::string &user_key, const std::string
&value, uint64_t ttl) {
- std::vector<StringPair> pairs{StringPair{user_key, value}};
- return MSet(pairs, /*ttl=*/ttl, /*lock=*/true);
-}
+rocksdb::Status String::Set(const std::string &user_key, const std::string
&value, uint64_t ttl, StringSetType type,
Review Comment:
OK, I will add a struct likes go-redis `SetArgs`.
```go
// SetArgs provides arguments for the SetArgs function.
type SetArgs struct {
// Mode can be `NX` or `XX` or empty.
Mode string
// Zero `TTL` or `Expiration` means that the key has no expiration time.
TTL time.Duration
ExpireAt time.Time
// When Get is true, the command returns the old value stored at key,
or nil when key did not exist.
Get bool
// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires
your redis-server version >= 6.0,
// otherwise you will receive an error: (error) ERR syntax error.
KeepTTL bool
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]