valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.91k stars 1.76k forks source link

feat (request): expose req timeout #1878

Closed aarcex3 closed 1 month ago

aarcex3 commented 1 month ago

Summary

Implemented GetRequestTimeout func to get the timeout attribute of the request.

Related Issue

1745

pd: is this what you guys had in mind?. I still need to document this btw.

erikdubbelboer commented 1 month ago

Why as a string?

aarcex3 commented 1 month ago

Just a PoC, I was waiting for some guidance and suggestion. What type of return data do you suggest?

erikdubbelboer commented 1 month ago

I think just returning a time.Duration is good. The most important part is the description of the function, it should describe exactly what this is for.

erikdubbelboer commented 1 month ago

Thanks!