Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(go): Add context support to all requests (#1527)
## 🧭 What and Why 🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-696 We need to provide a way to accept users' context while respecting general conventions in Go. ### Changes included: - Wrapper functions with a `WithContext` suffix added for all API methods to comply with the general DX standards. Ex: ``` // CreateAuthentication wraps CreateAuthenticationWithContext using context.Background. func (c *APIClient) CreateAuthentication(r ApiCreateAuthenticationRequest, opts ...Option) (*AuthenticationCreateResponse, error) { return c.CreateAuthenticationWithContext(context.Background(), r, opts...) } // @return AuthenticationCreateResponse func (c *APIClient) CreateAuthenticationWithContext(ctx context.Context, r ApiCreateAuthenticationRequest, opts ...Option) (*AuthenticationCreateResponse, error) { . . . // actual implementation } ``` - Playground example added to show context usage. ## 🧪 Test Code generation and CI pipeline should be enough.
- Loading branch information