temp
This commit is contained in:
33
internal/redis/utils.go
Normal file
33
internal/redis/utils.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package redis
|
||||
|
||||
//
|
||||
//func WriteString(ctx context.Context, key string, value string, ttl ...time.Duration) error {
|
||||
// if Client == nil {
|
||||
// return rueidis.Nil
|
||||
// }
|
||||
// var expiration time.Duration
|
||||
// if len(ttl) > 0 {
|
||||
// expiration = ttl[0]
|
||||
//
|
||||
// }
|
||||
// return (*Client).Do(ctx, (*Client).B().
|
||||
// Set().
|
||||
// Key(key).
|
||||
// Value(value).
|
||||
// Ex(expiration).
|
||||
// Build()).Error()
|
||||
//}
|
||||
//
|
||||
//func ReadString(ctx context.Context, key string) (string, error) {
|
||||
// if Client == nil {
|
||||
// return "", rueidis.Nil
|
||||
// }
|
||||
// resp := (*Client).Do(ctx, (*Client).B().
|
||||
// Get().
|
||||
// Key(key).
|
||||
// Build())
|
||||
// if resp.Error() != nil {
|
||||
// return "", resp.Error()
|
||||
// }
|
||||
// return resp.ToString()
|
||||
//}
|
||||
Reference in New Issue
Block a user