You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.)
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 whereConfig
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.
The text was updated successfully, but these errors were encountered: