Commit Graph

17 Commits

Author SHA1 Message Date
Vartan Benohanian
d128a7c4f7 Remove "before" field from Response
Listing responses only ever contain a non-empty "before" field when the
"count" parameter is provided, which is only useful for the HTML
website, not really needed for API clients

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-29 14:19:32 -04:00
Vartan Benohanian
15ee94fbbe Replace fmt.Sprint with strconv.Itoa, specify slice capacity
Uber's Go style guide outlines a slight performance benefit when using
strconv over fmt:
dc025303c1/style.md (prefer-strconv-over-fmt)

Also specifiying slice capacity when it is known beforehand:
dc025303c1/style.md (specifying-slice-capacity)

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-29 14:01:21 -04:00
Vartan Benohanian
e14a54f64e Create and edit a subreddit, get its settings
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-21 23:45:06 -04:00
Vartan Benohanian
e73b89f0b8 Finish LiveThreadService
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-18 01:20:18 -04:00
Vartan Benohanian
58278ffe5d Add more methods to LiveThreadService
- Close the live thread
- Configure a live thread's settings
- Invite a user
- Uninvite a user
- Set a contributors permissions
- Revoke a user's contributorship
- Report a live thread

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-17 23:46:41 -04:00
Vartan Benohanian
359f8126a1 Create LiveThreadService
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-15 22:26:27 -04:00
Vartan Benohanian
7bb73ddc6e Add stylesheet methods and more to subreddit service
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-13 21:43:59 -04:00
Vartan Benohanian
def7e3bdb7 Chage NewRequest methods, add multi description kind to thing
Since Reddit's API accepts form data as the body for most of its
endpoints, it made sense to me to make the default NewRequest method
set the request body as form data (if provided of course). The
NewJSONRequest method can accept a JSON body.

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-09 23:02:06 -04:00
Vartan Benohanian
078b172e81 Add methods to ModerationService, attribute to Post, use go v1.15
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-07 21:24:14 -04:00
Vartan Benohanian
a9e42b21b1 Get wiki page, get wiki page discussions
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-05 00:29:49 -04:00
Vartan Benohanian
9d5132f15c Create WikiService
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-03 23:25:16 -04:00
Vartan Benohanian
ffcc906c07 Add Listing/KarmaList to thing struct, tweak anonymous structs
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-01 22:35:28 -04:00
Vartan Benohanian
5bb7a155de Return bool when type casting, include trophies in thing struct
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-09-01 20:36:37 -04:00
Vartan Benohanian
b42aa44c44 Add Multi to thing struct
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-31 12:51:45 -04:00
Vartan Benohanian
57ee41b2cf Do unmarshaling in thing struct
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-30 21:25:01 -04:00
Vartan Benohanian
2a1806ec33 Revamp listing decoding, include after/before anchors in response
Now, instead of returning an object containing a list of results + the
anchors, we return just the list. The anchors are available in the
response object. Much cleaner this way in my opinion

go-github and godo do it this way too. They include some meta
information in the returned response objects

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-29 14:23:37 -04:00
Vartan Benohanian
f86a559d76 Move everything to new reddit/ folder
Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
2020-08-20 14:37:59 -04:00