diff options
| author | Bobby <[email protected]> | 2025-12-23 17:58:23 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-12-23 17:58:23 +0530 |
| commit | 5f691c04754ffd459b2ba0e434dc17585ba7c66c (patch) | |
| tree | c1eee98acfd8d2b02fba913d6d72a08531974432 /types/cache.go | |
| parent | f1172d2d420aad2587c06277a589705f1fe43bea (diff) | |
| download | lain-5f691c04754ffd459b2ba0e434dc17585ba7c66c.tar.xz lain-5f691c04754ffd459b2ba0e434dc17585ba7c66c.zip | |
folder cache for faster loads
Diffstat (limited to 'types/cache.go')
| -rw-r--r-- | types/cache.go | 20 |
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 +} |
