Skip to content
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

PoC: Create struct functions to perform API calls #7

Open
rbUUbr opened this issue Dec 23, 2019 · 0 comments
Open

PoC: Create struct functions to perform API calls #7

rbUUbr opened this issue Dec 23, 2019 · 0 comments

Comments

@rbUUbr
Copy link
Contributor

rbUUbr commented Dec 23, 2019

Currently I have an use-case when I need convert a lot of currencies to another currencies in a row. In my code I need to do something like this:

client := // client creating
for _, currency := range currencies {
  request := client.newRequest(...params)
  rsp, _ := client.do(request)
}

Here is the problem: I need to do a lot of actions to just convert the currency :(

  1. create client
  2. set up request
  3. perform request
    What if this library will have some kind of advanced API to do something like:
client := // client creating
for _, currency := range currencies {
  rsp, _ := client.ConvertCurrency(currency, "USD")
}

WDYT about it?

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

No branches or pull requests

1 participant