diff options
| author | Adnan Maolood <[email protected]> | 2021-02-22 21:35:02 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-22 21:35:02 -0500 |
| commit | 27299f537df54e4bf5ab342c46e899202565d913 (patch) | |
| tree | 41121bd3a6c434e7a60cf034b4d133115c6b3bae | |
| parent | server: Document use of contexts (diff) | |
| download | go-gemini-27299f537df54e4bf5ab342c46e899202565d913.tar.xz go-gemini-27299f537df54e4bf5ab342c46e899202565d913.zip | |
client: Document use of contexts
| -rw-r--r-- | client.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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. |