initial attempt to integrate surf http client
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package reddit
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
)
|
||||
@@ -10,17 +8,6 @@ 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>)
|
||||
|
||||
Reference in New Issue
Block a user