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

Add API client library / cli app? #4

Open
tko opened this issue Feb 8, 2024 · 1 comment
Open

Add API client library / cli app? #4

tko opened this issue Feb 8, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@tko
Copy link

tko commented Feb 8, 2024

This is an issue that came up in our own internal (private, sorry) app for which I've not found a good sample (though not having much time / priority to research.)

Let's say we want to have a service providing the following. Including some imaginary dependencies that are unique to each:

  1. a server -- postgres driver, SAML, OpenTelemetry
  2. client library to interact with the APIs -- (none)
  3. CLI client to interact with the APIs -- terminal colors

In its current form everything is in a single module and so any dependencies needed anywhere will become (indirect) dependencies to the clients, and if you're running security checks over your dependencies you can get flagged that your API client (which is not much more than a glorified http client) has a potential vulnerability due to a database driver/SAML/OpenTelemetry/LLMs -- any other library really -- which are implementation details of the server only and shouldn't really even be visible to the (http) clients.

I believe properly hiding the implementation details would require at least two, maybe three modules with different dependencies sets which isn't entirely trivial to set up (and harder to refactor into afterwards) and a blueprint would be helpful.

@bnkamalesh bnkamalesh self-assigned this Feb 9, 2024
@bnkamalesh bnkamalesh added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 9, 2024
@bnkamalesh
Copy link
Owner

@tko thanks a lot for the suggestion and I agree, it would be better to have nested Go modules to avoid unnecessary dependencies being downloaded when using lib. I have been planning a major refactor, and would include your suggestion as part of it.

#5 this is still in draft + in progress, would merge once it's polished enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants