func main() { // server.NewCli(ExampleServe).Run(os.Args) var unauth decorator.Decorator = decorator.NewPipeline(). Next(ProvideErrorHandling). Next(ProvideSession). Next(ProvideUserProfile) handler := unauth.Handle(H{}) res := httptest.NewRecorder() req := &http.Request{} handler(res, req) }
func (r *Server) Route(route string, pipe decorator.Decorator, h decorator.Handler) { r.HandleFunc(route, pipe.Handle(h)) }