-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transport/http: NewExplicitClient #971
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,12 @@ type DecodeRequestFunc func(context.Context, *http.Request) (request interface{} | |
// encodes the object directly to the request body. | ||
type EncodeRequestFunc func(context.Context, *http.Request, interface{}) error | ||
|
||
// CreateRequestFunc creates an outgoing HTTP request based on the passed | ||
// request object. It's designed to be used in HTTP clients, for client-side | ||
// endpoints. It's a more powerful version of EncodeRequestFunc, and can be used | ||
// if more fine-grained control of the HTTP request is required. | ||
type CreateRequestFunc func(context.Context, interface{}) (*http.Request, error) | ||
Comment on lines
+20
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you want to mark There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, because I don't consider it deprecated, this is just an alternative. |
||
|
||
// EncodeResponseFunc encodes the passed response object to the HTTP response | ||
// writer. It's designed to be used in HTTP servers, for server-side | ||
// endpoints. One straightforward EncodeResponseFunc could be something that | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add some meaningful comments here instead ? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an unexported function, and I find it pretty self-explanatory.