[jira] [Commented] (THRIFT-4320) Use interface instead of strict http.Client type in THttpClientOptions
[ https://issues.apache.org/jira/browse/THRIFT-4320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16293331#comment-16293331 ] Jens Geyer commented on THRIFT-4320: [~mbrysa], what do you say? > Use interface instead of strict http.Client type in THttpClientOptions > -- > > Key: THRIFT-4320 > URL: https://issues.apache.org/jira/browse/THRIFT-4320 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Marek Brysa >Priority: Minor > > {{THttpClientOptions}} (http_client.go) takes a strict {{http.Client}} type > which disallows developers from customizing http.Client or providing their > own implementation. I propose to replace this with an interface such as: > {code} > type HttpClient interface { > Do(req *http.Request) (*http.Response, error) > } > {code} > {{Do()}} is the only function of http.Client that is used (in > {{THttpClient.Flush()}}). -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (THRIFT-4320) Use interface instead of strict http.Client type in THttpClientOptions
[ https://issues.apache.org/jira/browse/THRIFT-4320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16162813#comment-16162813 ] Can Celasun commented on THRIFT-4320: - On second thought, this isn't necessary. In {{http_client.go}} we have a type, {{THttpClientOptions}}, which can be used to pass a custom a client. You can also choose to override the exported {{DefaultHttpClient}}. > Use interface instead of strict http.Client type in THttpClientOptions > -- > > Key: THRIFT-4320 > URL: https://issues.apache.org/jira/browse/THRIFT-4320 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Marek Brysa >Assignee: Can Celasun >Priority: Minor > > {{THttpClientOptions}} (http_client.go) takes a strict {{http.Client}} type > which disallows developers from customizing http.Client or providing their > own implementation. I propose to replace this with an interface such as: > {code} > type HttpClient interface { > Do(req *http.Request) (*http.Response, error) > } > {code} > {{Do()}} is the only function of http.Client that is used (in > {{THttpClient.Flush()}}). -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (THRIFT-4320) Use interface instead of strict http.Client type in THttpClientOptions
[ https://issues.apache.org/jira/browse/THRIFT-4320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16158299#comment-16158299 ] Can Celasun commented on THRIFT-4320: - Makes sense. I'll do it over the weekend. > Use interface instead of strict http.Client type in THttpClientOptions > -- > > Key: THRIFT-4320 > URL: https://issues.apache.org/jira/browse/THRIFT-4320 > Project: Thrift > Issue Type: Improvement > Components: Go - Library >Reporter: Marek Brysa >Priority: Minor > > {{THttpClientOptions}} (http_client.go) takes a strict {{http.Client}} type > which disallows developers from customizing http.Client or providing their > own implementation. I propose to replace this with an interface such as: > {code} > type HttpClient interface { > Do(req *http.Request) (*http.Response, error) > } > {code} > {{Do()}} is the only function of http.Client that is used (in > {{THttpClient.Flush()}}). -- This message was sent by Atlassian JIRA (v6.4.14#64029)