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

Get data for a given province (and county) #25

Open
dabcoder opened this issue Jun 1, 2020 · 0 comments
Open

Get data for a given province (and county) #25

dabcoder opened this issue Jun 1, 2020 · 0 comments

Comments

@dabcoder
Copy link

dabcoder commented Jun 1, 2020

GET ​/v2​/locations allows to add a province and county to filter data for a given country. Endpoints looking like the below:

  • /v2/locations?source=jhu&country_code=<code>&province=<province>
  • /v2/locations?source=jhu&country_code=<code>&province=<province>&county=<county>

Would it make sense to add another method to get data for a given province within a country and another one for a given county?

E.g (method signatures):

  • func (c Client) GetDataByProvince(ctx context.Context, countryCode string, province string, timelines bool) (data Locations, err error)
  • func (c Client) GetDataByCounty(ctx context.Context, countryCode string, province string, county string, timelines bool) (data Locations, err error)

However, I am not sure this is the best way to go about this (I think it's possible to filter by country and county and omit the province).
Another way I could think of would be to change the GetDataByCountryCode method signature to add 2 boolean arguments so that users could add province and/or county as filters, e.g:

func (c Client) GetDataByCountryCode(ctx context.Context, countryCode string, province bool, county bool, timelines bool) (data Locations, err error)

And then create the endpoint accordingly if those are set to true.
Either way, it might not be useful to add this, so feedback welcome.

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