go-json-rest
go-json-rest copied to clipboard
How to convert http.HandlerFunc to rest.HandlerFunc
I am trying to create a prometheus middleware for go-json-rest and I am running into issues due to the differences between the rest.ResponseWriter and the http.ResponseWriter
I am able to get the http.HandlerFunc for prometheus but when trying to get it into a rest.Get I am unable to convert the http.HandlerFunc into a rest.HandlerFunc as far as I can tell the only difference between them is the ResponseWriter
https://godoc.org/net/http#ResponseWriter https://godoc.org/github.com/ant0ine/go-json-rest/rest#ResponseWriter
Is there a way to accomplish this? I am fairly new to go so if the answer is pretty obvious I apologize in advance :)
Agreed. There should be methods to switch from http.Request to rest.Request. Same for ResponseWriter
@Telmo You mind checking if that PR fixes the issue?