Closed lizzzcai closed 1 year ago
@lizzzcai would you help with switching to fasthttp?
@lizzzcai would you help with switching to fasthttp?
Hi @benjaminhuo , sure, I can help with it, will do it in January.
@lizzzcai would you help with switching to fasthttp?
Hi @benjaminhuo , I quickly checked fasthttp yesterday, it probably does not fit here as it doesn't support request routing (path variables is not supported) and it is incompatible
with net/http (need a converter), can find details here.
My idea is to find an alternative router which is compatible with net/http
so that it will be easier to maintain and switch to another if the similar issue happens again. (dapr is switching from fasthttp to net/http).
One alternative I found is go-chi/chi, but I have to test if all the features we used in mux
are implemented in chi
, and the worse case is there will be some breaking changes, what do you think?
@lizzzcai would you help with switching to fasthttp?
Hi @benjaminhuo , I quickly checked fasthttp yesterday, it probably does not fit here as it doesn't support request routing (path variables is not supported) and it is
incompatible
with net/http (need a converter), can find details here.My idea is to find an alternative router which is compatible with
net/http
so that it will be easier to maintain and switch to another if the similar issue happens again. (dapr is switching from fasthttp to net/http).One alternative I found is go-chi/chi, but I have to test if all the features we used in
mux
are implemented inchi
, and the worse case is there will be some breaking changes, what do you think?
@wanjunlei Are we using https://github.com/emicklei/go-restful in KubeSphere?
One alternative I found is go-chi/chi, but I have to test if all the features we used in
mux
are implemented inchi
, and the worse case is there will be some breaking changes, what do you think?
chi looks good, we can give it a try. https://markphelps.me/posts/4-things-to-consider-when-choosing-a-go-api-framework/ It's indeed an alternative to gorilla/mux. The feature you want to use cannot be fulfilled by net/http right?
@lizzzcai would you help with switching to fasthttp?
Hi @benjaminhuo , I quickly checked fasthttp yesterday, it probably does not fit here as it doesn't support request routing (path variables is not supported) and it is
incompatible
with net/http (need a converter), can find details here. My idea is to find an alternative router which is compatible withnet/http
so that it will be easier to maintain and switch to another if the similar issue happens again. (dapr is switching from fasthttp to net/http). One alternative I found is go-chi/chi, but I have to test if all the features we used inmux
are implemented inchi
, and the worse case is there will be some breaking changes, what do you think?@wanjunlei Are we using https://github.com/emicklei/go-restful in KubeSphere?
Yes
chi looks good, we can give it a try. https://markphelps.me/posts/4-things-to-consider-when-choosing-a-go-api-framework/ It's indeed an alternative to gorilla/mux. The feature you want to use cannot be fulfilled by net/http right?
example like"/hello/{name}"
is not supported in net/http
. chi
looks lightweight and is actively maintained, I can give it a try first.
The gorilla/mux is in public archive mode due to lack of maintainers. We should switch to other implementations like fasthttp(used by Dapr) or other alternatives. If you have any good alternatives, please share them in the comment. Thanks.