MaxAge is a shortcut to set a simple duration as a MaxAgeFunc. Usage: app.Get("/", cache.Cache(cache.MaxAge(1*time.Minute), mainHandler)
(dur time.Duration)
| 58 | // Usage: |
| 59 | // app.Get("/", cache.Cache(cache.MaxAge(1*time.Minute), mainHandler) |
| 60 | func MaxAge(dur time.Duration) client.MaxAgeFunc { |
| 61 | return func(*context.Context) time.Duration { |
| 62 | return dur |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // Cache accepts the cache expiration duration. |
| 67 | // If the "maxAgeFunc" input argument is nil, |
no outgoing calls
searching dependent graphs…