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

Refactor the client to supports the context versions methods #221

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Joker-hh
Copy link
Contributor

@Joker-hh Joker-hh commented Apr 26, 2024

Background

For go programming, context is an approach to enable the callers to interpret the process positively.
However, The LMSTFY client just doesn't support it, So the PR tries to provide many new methods and support to pass the context into the client implementation process.

Comment on lines +43 to +47
if ctx != nil {
req, err = http.NewRequestWithContext(ctx, method, targetUrl, bodyReader)
} else {
req, err = http.NewRequest(method, targetUrl, bodyReader)
}
Copy link
Contributor Author

@Joker-hh Joker-hh Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the core refactor of how we supported the context methods, guys should keep in mind it when reviewing the other refactors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The methods in this file were not taking any large refactoring, just moved from the client.go to here, and support to passes the context.Context arg of the methods

@Joker-hh
Copy link
Contributor Author

Joker-hh commented Jul 1, 2024

@git-hulk Just reminding you to not forget this PR. It's ok to take a review any time you free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant