Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Customize http.Client in lyrics.New() #3

Open
BigB84 opened this issue Dec 3, 2021 · 1 comment · May be fixed by #4
Open

Customize http.Client in lyrics.New() #3

BigB84 opened this issue Dec 3, 2021 · 1 comment · May be fixed by #4

Comments

@BigB84
Copy link

BigB84 commented Dec 3, 2021

Hi,

thanks for such great, easy-to-use API !

I'd like to be able to customize http.Client in every provider (I mean If I use multiple providers at one time, same config'd be passed to each one)
Also, from what I've found out, currently only musixmatch uses http.Client:

res, err := http.DefaultClient.Do(req)

Example usage case:

  • to be able to use proxies (e.g. for anonymization)
  • increase timeout
  • someone may use predefined config like here
  • ... (All other http.Client goods)

This could be controlled like below:

import ("github.com/hashicorp/go-retryablehttp")
...
myClient := retryablehttp.NewClient().StandardClient() // Example of modified http.Client predefined in above lib
l := lyrics.New(myClient) // Passing it to the lyrics provider
...

Thanks in advance :)

rhnvrm added a commit that referenced this issue Dec 6, 2021
@rhnvrm rhnvrm linked a pull request Dec 6, 2021 that will close this issue
@rhnvrm
Copy link
Owner

rhnvrm commented Dec 6, 2021

Hey @BigB84, I have a draft open at #4. If you could please review / test it out that would be helpful as I don't use this project anymore in my production side projects.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants