Rob Loranger
d622687fa8
change NewClient to take baseURL
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
5 vuotta sitten
Rob Loranger
de8ce4dcd2
closes T589 update tests to use dev client
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
5 vuotta sitten
Abhinav Gupta
993ee50b3d
style: Run goimports on everything
Similar to writeas/writeas-cli#22 , this change runs goimports on all
files and changes the recommendation in the Contributing section to do
the same.
5 vuotta sitten
Matt Baer
b88b7e4e51
Reflect breaking v2 changes in examples and tests
5 vuotta sitten
Matt Baer
9b40a6fb2d
Fix post tests
5 vuotta sitten
Matt Baer
ed584d036d
Support unpinning posts
5 vuotta sitten
Matt Baer
d3ace8c73b
Support pinning posts
5 vuotta sitten
Matt Baer
b9ad92a1e1
Fix GetPost test looking for dev post
5 vuotta sitten
Matt Baer
fbe1c5830b
Add expected output on examples
6 vuotta sitten
Matt Baer
1864082f94
Add post creation GoDoc example
6 vuotta sitten
Matt Baer
07854c5fd7
Fix CreatePost tests
Previously, PostParams wasn't properly initialized.
6 vuotta sitten
Matt Baer
89c2661aed
Support deleting posts
Plus break up internal request building so we can optionally send query
parameters with some requests (like DELETEs!)
7 vuotta sitten
Matt Baer
8a9ac652f2
Support updating posts
Plus change Post's ModifyToken to Token.
7 vuotta sitten
Matt Baer
0376852c2f
Move `token` NewClient param to setter
7 vuotta sitten
Matt Baer
d2110756cd
Support creating a post
Plus fix Client post func and rename SubmittedPost to PostParams.
7 vuotta sitten
Matt Baer
04c8b73524
Support API v2
Includes ability to make authenticated requests and get posts.
7 vuotta sitten