aboutsummaryrefslogtreecommitdiff
path: root/redisDB.go
diff options
context:
space:
mode:
authoralex <[email protected]>2026-07-06 14:38:56 +0200
committeralex <[email protected]>2026-07-06 14:38:56 +0200
commit316b443addb7ec55e27f571ef489f2c19afb3a82 (patch)
treeb22dc242186b85b888cde0da002c8c95c0adcc99 /redisDB.go
parent48df6e2f7c36a859e7d76de23017eef84452c0ed (diff)
downloadredis-clone-316b443addb7ec55e27f571ef489f2c19afb3a82.tar.xz
redis-clone-316b443addb7ec55e27f571ef489f2c19afb3a82.zip
added struct Item and keyowrd EXPIRE so now we can track expire time of items in the db
Diffstat (limited to 'redisDB.go')
-rw-r--r--redisDB.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/redisDB.go b/redisDB.go
index f21ac50..9138971 100644
--- a/redisDB.go
+++ b/redisDB.go
@@ -3,11 +3,15 @@ package main
import (
"fmt"
"sync"
+ "time"
)
-
+type Item struct {
+ Value any
+ ExpiresAt *time.Time
+}
type RedisDB struct {
mu sync.Mutex
- data map[string]any
+ data map[string]Item
}
type SimpleString string