From 7142bdb879357709a22a5054584b022a963ab6a1 Mon Sep 17 00:00:00 2001 From: gabrielluizsf <93672097+gabrielluizsf@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:55:56 -0300 Subject: [PATCH] adding documentation --- client.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 88182b6..d01e3d8 100644 --- a/client.go +++ b/client.go @@ -6,20 +6,28 @@ import ( ) type Client interface { + // Get sends an HTTP GET request to the specified URL with the given options. Get(url string, options *Options) (*http.Response, error) + // Post sends an HTTP POST request to the specified URL with the given options. Post(url string, options *Options) (*http.Response, error) + // Put sends an HTTP PUT request to the specified URL with the given options. Put(url string, options *Options) (*http.Response, error) + // Patch sends an HTTP PATCH request to the specified URL with the given options. Patch(url string, options *Options) (*http.Response, error) + // Delete sends an HTTP DELETE request to the specified URL with the given options. Delete(url string, options *Options) (*http.Response, error) + // Context returns the context associated with the HTTP client. + // This context can be used to control the lifecycle of HTTP requests, + // allowing for cancellation, timeout. Context() context.Context } type client struct { - ctx context.Context + ctx context.Context client *http.Client } -func (c *client) Context() context.Context{ +func (c *client) Context() context.Context { return c.ctx }