summaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-12-23 17:58:23 +0530
committerBobby <[email protected]>2025-12-23 17:58:23 +0530
commit5f691c04754ffd459b2ba0e434dc17585ba7c66c (patch)
treec1eee98acfd8d2b02fba913d6d72a08531974432 /types
parentf1172d2d420aad2587c06277a589705f1fe43bea (diff)
downloadlain-5f691c04754ffd459b2ba0e434dc17585ba7c66c.tar.xz
lain-5f691c04754ffd459b2ba0e434dc17585ba7c66c.zip
folder cache for faster loads
Diffstat (limited to 'types')
-rw-r--r--types/cache.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/types/cache.go b/types/cache.go
new file mode 100644
index 0000000..497151e
--- /dev/null
+++ b/types/cache.go
@@ -0,0 +1,20 @@
+package types
+
+import (
+ "sync"
+ "time"
+
+ "github.com/gofiber/fiber/v2"
+)
+
+type FolderCacheEntry struct {
+ Folders []fiber.Map
+ CachedAt time.Time
+ ExpiresAt time.Time
+}
+
+type FolderCache struct {
+ Mu sync.RWMutex
+ Data map[string]*FolderCacheEntry
+ TTL time.Duration
+}