summaryrefslogtreecommitdiff
path: root/internal/fetch/fetch.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fetch/fetch.go')
-rw-r--r--internal/fetch/fetch.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/fetch/fetch.go b/internal/fetch/fetch.go
index f508922..f22139d 100644
--- a/internal/fetch/fetch.go
+++ b/internal/fetch/fetch.go
@@ -8,7 +8,11 @@ import (
"time"
)
-func fetch(rawURL string, timeoutSecs int) (io.Reader, error) {
+// Fetch makes a GET request to rawURL, returning the HTML contents of
+// that webpage in the form of an [io.Reader]. An error is also
+// returned. The parameter timeoutSecs is passed directly to the
+// [http.Client.Timeout] field of the client making the request.
+func Fetch(rawURL string, timeoutSecs int) (io.Reader, error) {
client := http.Client{
Timeout: time.Duration(timeoutSecs) * time.Second,
}