Replies: 2 comments 1 reply
-
You can use nethttp middlewares and put URL (or anything from |
Beta Was this translation helpful? Give feedback.
-
I'm sorry, I'm not understanding. I'm not looking to put something into the context. I'm seeking to find something in the context that was put into the context by ogen. For instance, in code that implements https://github.com/docktermj/go-rest-api-client/blob/ef03165351138463685dc49c57c59670c30b8347/senzingrestapi/oas_unimplemented_gen.go#L331-L333, would look something like: func (c MyStruct) Heartbeat(ctx context.Context) (r *SzBaseResponse, _ error) {
requestUrl := ctx.Value(????).(*url.URL)
:
} What do I replace "????" to get the |
Beta Was this translation helpful? Give feedback.
-
What version of ogen are you using?
Can this issue be reproduced with the latest version?
Yes
What did you do?
Given the code generated by ogen:
https://github.com/docktermj/go-rest-api-client/blob/ef03165351138463685dc49c57c59670c30b8347/senzingrestapi/oas_unimplemented_gen.go#L331-L333
How do I find the URL of the request? Specifically the hostname of the requester.
I know it's buried in the context
withValue()
but I can't find the keys so that I can do
Is that how I should be finding the URL? If so, what is the value of "???" I should use?
Beta Was this translation helpful? Give feedback.
All reactions