Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 chore: Update documentation for Fiber client #3249

Merged
merged 13 commits into from
Dec 16, 2024
Prev Previous commit
Next Next commit
Update inline docs
gaby authored Dec 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 584283c077a44e6ea4738c3df4ebdafc473125b9
5 changes: 4 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
@@ -283,7 +283,9 @@ func (c *Client) AddHeaders(h map[string][]string) *Client {
return c
}

// SetHeaders sets multiple header fields and their values in the client.
// SetHeaders method sets multiple headers field and its values at one go in the client instance.
// These headers will be applied to all requests created from this client instance. Also it can be
// overridden at request level headers options.
func (c *Client) SetHeaders(h map[string]string) *Client {
c.header.SetHeaders(h)
return c
@@ -301,6 +303,7 @@ func (c *Client) Param(key string) []string {
}

// AddParam adds a single query parameter and its value to the client.
// These params will be applied to all requests created from this client instance.
func (c *Client) AddParam(key, val string) *Client {
c.params.Add(key, val)
return c
1 change: 1 addition & 0 deletions client/request.go
Original file line number Diff line number Diff line change
@@ -116,6 +116,7 @@ func (r *Request) Context() context.Context {
}

// SetContext sets the context for the Request, allowing request cancellation if ctx is done.
// See https://blog.golang.org/context article and the "context" package documentation.
func (r *Request) SetContext(ctx context.Context) *Request {
r.ctx = ctx
return r