Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4320

Use interface instead of strict http.Client type in THttpClientOptions

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Information Provided
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Go - Library
    • Labels:
      None

      Description

      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:

      type HttpClient interface {
      	Do(req *http.Request) (*http.Response, error)
      }
      

      Do() is the only function of http.Client that is used (in THttpClient.Flush()).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mbrysa Marek Brysa
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: