richzw / appstore

App Store Server API Golang Client
MIT License
132 stars 26 forks source link

fix: change the type of httpCli to HTTPClient #12

Closed holyachon closed 5 months ago

holyachon commented 5 months ago

PR about #11

I think type of httpClient in StoreClient is *http.Client, so user can't use those functions like SetResponseErrorHandler, SetRetry out of library code to wrap client.

I expect that after this change, user can write below code.

        httpClient := &http.Client{}
    client := SetRetry(httpClient, &JitterBackoff{}, ShouldRetryDefault)
    storeClient := NewStoreClientWithHTTPClient(&StoreConfig{...}, client)

Feel free to give your opinion that improves this PR or change the way of implementation. Thank you.

richzw commented 5 months ago

Got it. Thank you very much for your detailed response and your PR.

LGTM.