aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-22 21:35:02 -0500
committerAdnan Maolood <[email protected]>2021-02-22 21:35:02 -0500
commit27299f537df54e4bf5ab342c46e899202565d913 (patch)
tree41121bd3a6c434e7a60cf034b4d133115c6b3bae
parentserver: Document use of contexts (diff)
downloadgo-gemini-27299f537df54e4bf5ab342c46e899202565d913.tar.xz
go-gemini-27299f537df54e4bf5ab342c46e899202565d913.zip
client: Document use of contexts
-rw-r--r--client.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/client.go b/client.go
index d9a0718..4656d74 100644
--- a/client.go
+++ b/client.go
@@ -29,6 +29,8 @@ type Client struct {
}
// Get sends a Gemini request for the given URL.
+// If the provided context is canceled or times out, the request
+// will be aborted and the context's error will be returned.
//
// An error is returned if there was a Gemini protocol error.
// A non-2x status code doesn't cause an error.
@@ -45,8 +47,9 @@ func (c *Client) Get(ctx context.Context, url string) (*Response, error) {
return c.Do(ctx, req)
}
-// Do sends a Gemini request and returns a Gemini response, following
-// policy as configured on the client.
+// Do sends a Gemini request and returns a Gemini response.
+// If the provided context is canceled or times out, the request
+// will be aborted and the context's error will be returned.
//
// An error is returned if there was a Gemini protocol error.
// A non-2x status code doesn't cause an error.