Documentation ¶
Overview ¶
Package httputils is a generated GoMock package.
Index ¶
Constants ¶
View Source
const Timeout = 30 * time.Second
Variables ¶
This section is empty.
Functions ¶
func ReadBody ¶
func ReadBody(body io.ReadCloser) ([]byte, error)
ReadBody reads the body of a response and returns it as a byte slice.
func ReadBodyJSON ¶
func ReadBodyJSON(body io.ReadCloser, v interface{}) error
ReadBodyJSON reads the body of a response and unmarshals the JSON into the given interface
Types ¶
type Downloader ¶
func NewDownloader ¶
func NewDownloader(userAgent string) Downloader
type MockDownloader ¶
type MockDownloader struct {
// contains filtered or unexported fields
}
MockDownloader is a mock of Downloader interface.
func NewMockDownloader ¶
func NewMockDownloader(ctrl *gomock.Controller) *MockDownloader
NewMockDownloader creates a new mock instance.
func (*MockDownloader) EXPECT ¶
func (m *MockDownloader) EXPECT() *MockDownloaderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDownloaderMockRecorder ¶
type MockDownloaderMockRecorder struct {
// contains filtered or unexported fields
}
MockDownloaderMockRecorder is the mock recorder for MockDownloader.
func (*MockDownloaderMockRecorder) Download ¶
func (mr *MockDownloaderMockRecorder) Download(ctx, url interface{}) *gomock.Call
Download indicates an expected call of Download.
type UserAgents ¶
type UserAgents interface { GetLatest(ctx context.Context) ([]string, error) GetRandom(ctx context.Context) (string, error) }
UserAgents used for getting the latest browser user agents
func NewLatestUserAgents ¶
func NewLatestUserAgents(client *http.Client) UserAgents
Click to show internal directories.
Click to hide internal directories.