Skip to content

Commit

Permalink
further document wrapperClient
Browse files Browse the repository at this point in the history
  • Loading branch information
natebrennand committed Nov 7, 2022
1 parent ca4bc43 commit fa94b6c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/base_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ type BaseClientWithCtx interface {
headers map[string]interface{}) (*http.Response, error)
}

// wrapperClient wraps the lower level BaseClient to fulfill the BaseClientWithCtx interface. This
// allows the SDK to utilize the BaseClientWithCtx method throughout the codebase.
//
// All *WithCtx methods of a wrapped client will not actually use their context.Context argument.
type wrapperClient struct {
// embed the BaseClient so the functions remain accessible
BaseClient
}

// SendRequestWithCtx passes the request through to the underlying BaseClient. The context.Context
// argument is not utilized.
func (w wrapperClient) SendRequestWithCtx(ctx context.Context, method string, rawURL string, data url.Values,
headers map[string]interface{}) (*http.Response, error) {
return w.SendRequest(method, rawURL, data, headers)
Expand Down

0 comments on commit fa94b6c

Please sign in to comment.