Esempio n. 1
0
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)
}
Esempio n. 2
0
func (r *Server) Route(route string, pipe decorator.Decorator, h decorator.Handler) {
	r.HandleFunc(route, pipe.Handle(h))
}