Ejemplo n.º 1
0
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	ctx := rocket.NewContext(w, r, 200, 0)
	s.handler(ctx)
}
Ejemplo n.º 2
0
func createContext(method, URI string) *rocket.Context {
	req, _ := http.NewRequest(method, URI, nil)
	req.RequestURI = URI
	return rocket.NewContext(nil, req, 0, 0)
}
func createContext(bodyContent, method, url string) *rocket.Context {
	reader := strings.NewReader(bodyContent)
	req, _ := http.NewRequest(method, url, reader)
	ctx := rocket.NewContext(nil, req, 0, 0)
	return ctx
}