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

Decouple API from echo.Context #16

Open
seilagamo opened this issue Mar 22, 2023 · 0 comments
Open

Decouple API from echo.Context #16

seilagamo opened this issue Mar 22, 2023 · 0 comments

Comments

@seilagamo
Copy link
Collaborator

I know this is something that was not introduced in this PR, and we don't need to modify it now, but I in future when we have time, I wouldn't pass the echo.Context to the methods defined in the API struct. That's because, by doing so, we are coupling the API with the HTTP library that we are using to expose it even if we don't need to. In this function, we don't use the context at all, in other cases where we are using the context to retrieve some parameters, for instance the teamID, we could just directly pass that parameter to the function. By not coupling the API with the HTTP framework we make it easy to test the component and reason about it.

Originally posted by @manelmontilla in #12 (comment)

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

No branches or pull requests

1 participant