summaryrefslogtreecommitdiff
path: root/internal/httpclient/client.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-01-27 15:54:59 +0000
committerLibravatar GitHub <noreply@github.com>2025-01-27 15:54:59 +0000
commit726d2ba483b58402fa5e8d5a99d5cbd290bdeb67 (patch)
treeec597aa14d4c5cd8f36661750ff71a3ffbc2eb2d /internal/httpclient/client.go
parentbumps uptrace/bun deps to v1.2.8 (#3698) (diff)
downloadgotosocial-726d2ba483b58402fa5e8d5a99d5cbd290bdeb67.tar.xz
[chore] some tidy ups (#3677)
* small formatting changes (no logic) * improve code comments * fix import cycle * shutup stinky linter
Diffstat (limited to 'internal/httpclient/client.go')
-rw-r--r--internal/httpclient/client.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/httpclient/client.go b/internal/httpclient/client.go
index 10fba5d42..445c6a9e5 100644
--- a/internal/httpclient/client.go
+++ b/internal/httpclient/client.go
@@ -178,6 +178,9 @@ func New(cfg Config) *Client {
return &c
}
+// RoundTrip allows httpclient.Client{} to be used as an http.Transport{}, just calling Client{}.Do().
+func (c *Client) RoundTrip(r *http.Request) (rsp *http.Response, err error) { return c.Do(r) }
+
// Do will essentially perform http.Client{}.Do() with retry-backoff functionality.
func (c *Client) Do(r *http.Request) (rsp *http.Response, err error) {