Documentation
¶
Index ¶
Constants ¶
const ( // HomepageCacheKey is used to cache the rendered homepage HomepageCacheKey = "homepage-cache" NavigationCacheKey = "navigation-cache" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HomepageCache ¶
HomepageCache is a wrapper to dpcache.Cache which has additional fields and methods specifically for caching homepage data
func NewHomepageCache ¶
NewHomepageCache create a homepage cache object to be used in the service which will update at every updateInterval If updateInterval is nil, this means that the cache will only be updated once at the start of the service
func (*HomepageCache) AddUpdateFunc ¶
func (hc *HomepageCache) AddUpdateFunc(key string, updateFunc func() (*model.HomepageData, error))
AddUpdateFunc adds an update function to the homepage cache
type NavigationCache ¶
type NavigationCache struct {
}NavigationCache is a wrapper to dpcache.Cache which has additional fields and methods specifically for caching navigation data
func NewNavigationCache ¶
func NewNavigationCache(ctx context.Context, updateInterval *time.Duration) (*NavigationCache, error)
NewNavigationCache create a navigation cache object to be used in the service which will update at every updateInterval If updateInterval is nil, this means that the cache will only be updated once at the start of the service
func (*NavigationCache) AddUpdateFunc ¶
func (nc *NavigationCache) AddUpdateFunc(key string, updateFunc func() *models.Navigation)
AddUpdateFunc adds an update function to the homepage cache