Revert "initial attempt to integrate surf http client"

This reverts commit 538d52d064.
This commit is contained in:
2026-01-24 15:00:30 -06:00
parent 538d52d064
commit 8c85da5472
45 changed files with 109 additions and 196 deletions
+13
View File
@@ -1,6 +1,8 @@
package reddit
import (
"errors"
"net/http"
"net/url"
"os"
)
@@ -8,6 +10,17 @@ import (
// Opt is used to further configure a client upon initialization.
type Opt func(*Client) error
// WithHTTPClient sets the HTTP client which will be used to make requests.
func WithHTTPClient(httpClient *http.Client) Opt {
return func(c *Client) error {
if httpClient == nil {
return errors.New("*http.Client: cannot be nil")
}
c.client = httpClient
return nil
}
}
// WithUserAgent sets the User-Agent header for requests made with the client.
// Reddit recommends the following format for the user agent:
// <platform>:<app ID>:<version string> (by /u/<reddit username>)