IsOld returns true if the timestamp is considered old.
(t time.Time, maxAge time.Duration)
| 232 | |
| 233 | // IsOld returns true if the timestamp is considered old. |
| 234 | func IsOld(t time.Time, maxAge time.Duration) bool { |
| 235 | oldest := time.Now().Add(-maxAge) |
| 236 | return t.Before(oldest) |
| 237 | } |
| 238 | |
| 239 | // Wrap returns a backend with a cache. |
| 240 | func (c *Cache) Wrap(be backend.Backend, errorLog func(string, ...interface{})) backend.Backend { |