MCPcopy Index your code
hub / github.com/kataras/iris / Handler

Function Handler

cache/cache.go:89–96  ·  view source on GitHub ↗

Handler like `Cache` but returns an Iris Handler to be used as a middleware. For more options use the `Cache`. Examples can be found at: https://github.com/kataras/iris/tree/main/_examples/response-writer/cache

(expiration time.Duration)

Source from the content-addressed store, hash-verified

87//
88// Examples can be found at: https://github.com/kataras/iris/tree/main/_examples/response-writer/cache
89func Handler(expiration time.Duration) context.Handler {
90 maxAgeFunc := func(*context.Context) time.Duration {
91 return expiration
92 }
93
94 h := Cache(maxAgeFunc).ServeHTTP
95 return h
96}

Callers 6

TestClientNoCacheFunction · 0.92
TestCacheFunction · 0.92
TestCacheValidatorFunction · 0.92
main.goFile · 0.92
main.goFile · 0.92
mainFunction · 0.92

Calls 1

CacheFunction · 0.70

Tested by 3

TestClientNoCacheFunction · 0.74
TestCacheFunction · 0.74
TestCacheValidatorFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…