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

Method Record

context/context.go:6057–6065  ·  view source on GitHub ↗

+------------------------------------------------------------+ | Advanced: Response Recorder | +------------------------------------------------------------+ Record transforms the context's basic and direct responseWriter to a *ResponseRecorder which can be used to res

()

Source from the content-addressed store, hash-verified

6055// which can be used to reset the body, reset headers, get the body,
6056// get & set the status code at any time and more.
6057func (ctx *Context) Record() {
6058 switch w := ctx.writer.(type) {
6059 case *ResponseRecorder:
6060 default:
6061 recorder := AcquireResponseRecorder()
6062 recorder.BeginRecord(w)
6063 ctx.ResetResponseWriter(recorder)
6064 }
6065}
6066
6067// Recorder returns the context's ResponseRecorder
6068// if not recording then it starts recording and returns the new context's ResponseRecorder

Callers 9

RecorderMethod · 0.95
handlerFunction · 0.80
HandlerMethod · 0.80
TestBasicAuthUseRouterFunction · 0.80
TestOnAnyErrorCodeFunction · 0.80
TestRegisterRuleOverlapFunction · 0.80

Calls 3

ResetResponseWriterMethod · 0.95
AcquireResponseRecorderFunction · 0.85
BeginRecordMethod · 0.80

Tested by 5

TestBasicAuthUseRouterFunction · 0.64
TestOnAnyErrorCodeFunction · 0.64
TestRegisterRuleOverlapFunction · 0.64