this changes both NewClient and NewTorClient to take a required
parameter for baseURL. removing hard coded api URLS. both still default
to write.as api URLs.
NewDevClient was removed as the base URL can now be provided
one test was still using the production server for tests, changed to dev
this changes tests to only use the dev client as all code is shared
between that and the write.as client, just the host changes.
also updated post tests to round trip and test over sub tests
tests were failing on expected write.as blog title
previously the title was 'write.as' and it is now 'write.as blog'
also removed test case ExampleClient_GetCollection as was a duplicate of
TestGetCollection
Rather than accepting a naked string, accept a DeleteCollectionParams
struct so that new optional parameters can be added in the future
without breaking the API.
This adds a new constructor to build Clients which operates on a Config
struct rather than positional parameters. This will enable adding new
parameters in the future without breaking the API.
To begin with, this introduces a new URL parameter that wasn't
previously available. An example of another parameter that could be
added in the future is the timeout (to override the default timeout).
Existing constructors have been transitioned to the new one because it
implements a superset of their functionality.
Minor note: The Tor constructor wasn't respecting the default timeout
but with this version, it does.
Resolves#8
Moves the ID and token params out of PostParams and into the func's
parameters. A currently-unused `collection` parameter is left in for the
future, when the backend supports updating and deleting collection posts
via slug, not post ID.