Skip to content

Commit 2edb19e

Browse files
committed
use generic types in cache
1 parent 94791cf commit 2edb19e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cache/cache.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ func Client() *redis.Client {
5151
}
5252

5353
// Set ...
54-
func Set[T any](key string, value T) {
55-
conn.set(key, helpers.ToBytes(value))
54+
func Set[T any](key string, value T) error {
55+
return conn.set(key, helpers.ToBytes(value))
5656
}
5757

5858
// SetWithExpiry ...
59-
func SetWithExpiry[T any](key string, value T, expiry time.Duration) {
60-
conn.setWithExpiry(key, helpers.ToBytes(value), expiry)
59+
func SetWithExpiry[T any](key string, value T, expiry time.Duration) error {
60+
return conn.setWithExpiry(key, helpers.ToBytes(value), expiry)
6161
}
6262

6363
// Get ...
@@ -71,8 +71,8 @@ func Get[T any](key string) (T, error) {
7171
}
7272

7373
// Delete ...
74-
func Delete(key string) {
75-
conn.delete(key)
74+
func Delete(key string) error {
75+
return conn.delete(key)
7676
}
7777

7878
// CleanUp ...

0 commit comments

Comments
 (0)