kratos
kratos copied to clipboard
`http.Client.Do()` not support `WithMiddleware()` option
https://github.com/go-kratos/kratos/blob/de0e4e222832ff076734ebe50a7df9de46e4ae43/transport/http/client.go#L272
After I looked the code, I found it's hard to implement this feature, as client.Invoke()
use
middleware.Hanler
(type Handler func(ctx context.Context, req interface{}) (interface{}, error)
) model,
but client.Do()
use the standard http lib model (func (c *Client) Do(req *Request) (*Response, error)
).
It's impossible to convert client.Do()
model to middleware.Hanler
model.
Does anyone have better ideas?
I'll take this in these days 这几天我来搞一下这个吧
@tonybase plz review it @shenqidebaozi plz review it
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Is there any update on this question?
Hi, @ionling! I'm Dosu, and I'm helping the kratos team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, the issue is that the http.Client.Do()
method does not support the WithMiddleware()
option in the Kratos framework. You were seeking suggestions for a solution. There have been recent comments from users wang-tsh and kratos-ci-bot, but there haven't been any updates on the issue yet.
Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the kratos repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.
Thank you for your understanding and contribution to the kratos project!
According the code: https://github.com/go-kratos/kratos/blob/3fc8fb7a0a0bd35f7f934cbb7ca26814cbc49132/transport/http/client.go#L270
it is still relevant to the latest version of the kratos repository.
@kratos-ci-bot Could you please help @ionling with this issue? They have indicated that the issue is still relevant to the latest version of the kratos repository. Thank you!
Hi, @ionling,
I'm helping the Kratos team manage their backlog and am marking this issue as stale. It seems like you're struggling to implement the WithMiddleware()
option in http.Client.Do()
in the Kratos framework due to a mismatch between the client.Invoke()
and client.Do()
models. There have been recent comments from users wang-tsh and kratos-ci-bot, and I see that you've confirmed that the issue is still relevant to the latest version of the Kratos repository.
Could you please let us know if the issue is still relevant to the latest version of the Kratos repository? If it is, please provide any additional context or updates. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.
Thank you for your understanding and cooperation. Your input is valuable in helping us maintain the repository effectively.
I (Dosu)