package models import "sync" type cache struct { Data map[string]any Mu sync.RWMutex } var ( PagesCache = cache{Data: make(map[string]any)} ) func (c *cache) Get(key string) (any, bool) { c.Mu.RLock() pageData, ok := c.Data[key] c.Mu.RUnlock() return pageData, ok } func (c *cache) Set(key string, data any) { c.Mu.Lock() c.Data[key] = data c.Mu.Unlock() }