From 5f691c04754ffd459b2ba0e434dc17585ba7c66c Mon Sep 17 00:00:00 2001 From: Bobby <30593201+luciferreeves@users.noreply.github.com> Date: Tue, 23 Dec 2025 17:58:23 +0530 Subject: folder cache for faster loads --- types/cache.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 types/cache.go (limited to 'types') 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 +} -- cgit v1.2.3