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

Overriding base URL #8

Closed
abhinav opened this issue Dec 16, 2018 · 2 comments
Closed

Overriding base URL #8

abhinav opened this issue Dec 16, 2018 · 2 comments

Comments

@abhinav
Copy link
Contributor

abhinav commented Dec 16, 2018

Overview

The library has 3 hard-coded URLs for the API service. It should probably
support changing the URL for testing and to allow users to point the client to
their own instance of WriteFreely.

Implementation

Rather than add another parameter to the constructors (thus breaking the API),
I propose adding a NewClientWith(Config) *Client constructor where Config
is a struct with a bunch of optional fields. This will also allow adding other
new optional parameters for client configuration in the future without
breaking the API.

@thebaer
Copy link
Member

thebaer commented Dec 16, 2018

Great idea. I started on a library a while ago that might be able to do just this today, and would work for future libraries (e.g. go-snapas, go-jotas, etc.)

@abhinav
Copy link
Contributor Author

abhinav commented Dec 17, 2018

Resolved by #9.

@abhinav abhinav closed this as completed Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants