func timerResponseProcessor(r gofw.Request, w gofw.Response, a gofw.URLArgs) (gofw.Request, gofw.Response, gofw.URLArgs) { fmt.Println("ResponseMiddleware-Timer") time.Sleep(56 * time.Millisecond) fmt.Fprintf(w.RawHttpResponseWriter, "\nPage rendered in: %s", time.Now().Sub(w.Get("timerStart").(time.Time))) return r, w, a }
func timerRequestProcessor(r gofw.Request, w gofw.Response, a gofw.URLArgs) (gofw.Request, gofw.Response, gofw.URLArgs) { fmt.Println("RequestMiddleware-Timer") w.Set("timerStart", time.Now()) return r, w, a }
func serverHeaderRequestProcessor(r gofw.Request, w gofw.Response, a gofw.URLArgs) (gofw.Request, gofw.Response, gofw.URLArgs) { fmt.Println("RequestMiddleware") w.SetHeader("Server", "Smile :)") return r, w, a }