MCPcopy Create free account
hub / github.com/kataras/iris / WithKey

Function WithKey

cache/cache.go:42–47  ·  view source on GitHub ↗

WithKey sets a custom entry key for cached pages. Should be prepended to the cache handler. Usage: app.Get("/", cache.WithKey("custom-key"), cache.Handler(time.Minute), mainHandler)

(key string)

Source from the content-addressed store, hash-verified

40// Usage:
41// app.Get("/", cache.WithKey("custom-key"), cache.Handler(time.Minute), mainHandler)
42func WithKey(key string) context.Handler {
43 return func(ctx *context.Context) {
44 client.SetKey(ctx, key)
45 ctx.Next()
46 }
47}
48
49// DefaultMaxAge is a function which returns the
50// `context#MaxAge` as time.Duration.

Callers 1

mainFunction · 0.92

Calls 2

SetKeyFunction · 0.92
NextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…