(duration time.Duration)
| 257 | } |
| 258 | |
| 259 | func (w *widgetBase) withCacheDuration(duration time.Duration) *widgetBase { |
| 260 | w.cacheType = cacheTypeDuration |
| 261 | |
| 262 | if duration == -1 || w.CustomCacheDuration == 0 { |
| 263 | w.cacheDuration = duration |
| 264 | } else { |
| 265 | w.cacheDuration = time.Duration(w.CustomCacheDuration) |
| 266 | } |
| 267 | |
| 268 | return w |
| 269 | } |
| 270 | |
| 271 | func (w *widgetBase) withCacheOnTheHour() *widgetBase { |
| 272 | w.cacheType = cacheTypeOnTheHour |
no outgoing calls
no test coverage detected