You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func(mc *MyContext) RequestStart(whttp.ResponseWriter, r *http.Request) {
122
-
mc.Ctx.RequestStart(w, r) // MUST be called!
123
-
124
-
// do whatever you need to on request start, db connections, variable init...
125
-
}
126
-
127
-
// RequestEnd overriding
128
-
func(mc *MyContext) RequestEnd() {
129
-
// do whatever you need on request finish, reset variables, db connections...
130
-
131
-
mc.Ctx.RequestEnd() // MUST be called!
132
-
}
133
-
134
120
// CustomContextFunction is a function that is specific to your applications needs that you added
135
121
func(mc *MyContext) CustomContextFunction() {
136
122
// do something
@@ -258,7 +244,7 @@ recovery middleware are very application dependent and therefore will be listed
258
244
259
245
Benchmarks
260
246
-----------
261
-
Run on MacBook Pro (Retina, 15-inch, Late 2013) 2.6 GHz Intel Core i7 16 GB 1600 MHz DDR3 using Go version go1.7 darwin/amd64
247
+
Run on MacBook Pro (15-inch, 2017) 3.1 GHz Intel Core i7 16GB DDR3 using Go version go1.9.2 darwin/amd64
262
248
263
249
NOTICE: lars uses a custom version of [httprouter](https://github.com/julienschmidt/httprouter), benchmarks can be found [here](https://github.com/joeybloggs/go-http-routing-benchmark/tree/lars-only)
264
250
@@ -276,22 +262,25 @@ go test -bench=. -benchmem=true
0 commit comments