feat: add Apps endpoint and query parameter support

- add `Apps` endpoint to the `Client` struct and initialize it in
`NewClient`
- implement `doWithJsonResponse` helper to handle request execution and
JSON decoding in one step
- update `newRequest` to support passing and encoding query parameters
via `net/url`
- rename `Option` to `ClientOption` for better clarity in the
`NewClient` signature
- refactor `Ping` tests to use a more structured nested layout
- remove `option.go` and `option_test.go` as part of the configuration
refactor
This commit is contained in:
Stevan Freeborn
2026-01-15 16:38:47 -06:00
parent 62426530bd
commit 1f6218416c
7 changed files with 339 additions and 89 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ type PingEndpoint struct {
// log.Fatal("Ping failed:", err)
// }
func (p *PingEndpoint) Get(ctx context.Context) error {
req, err := p.client.newRequest(ctx, http.MethodGet, pingPath, nil)
req, err := p.client.newRequest(ctx, http.MethodGet, pingPath, nil, nil)
if err != nil {
return err