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

Plans to extract the API client lib (from pkg/client) into its own repository? #39

Open
andygrunwald opened this issue Feb 8, 2025 · 2 comments

Comments

@andygrunwald
Copy link

Are there any plans to extract the Paperless Go Client lib (living in pkg/client) into its own repository?

This would have a couple of benefits:

  • Discovery: When someone (like me) is looking for a Go client lib for Paperless, right now, it is not easy to find that the paperhooks repository has it as a sub-package. While this being an own repository, It would be easier to find (primarily via Google)
  • Increased contribution/docs: Additional discovery may lead to increased contribution and its own documentation
  • Independent development and release cycles: While the API of paperless evolves, the client lib evolves. Such feature development may not touch the webhook functionality of paperless (what paperhooks is mostly covering) - A new client endpoint in the client lib would require a new release without having additional features for paperhooks itself
  • Dependency management: While other implementations (e.g. https://github.com/hansmi/prometheus-paperless-exporter) may require only the client lib and not the paperhooks functionality, a full dependency/download is required (with all its downsides of having dependencies and non used code)

Switching it would also have a couple of downsides:

  • Additional development step: While you (@hansmi) maintain paperhooks, the paperless exporter and the client lib, an additional development step and additional maintenance overhead
  • Breaking change: Folks who are importing pkg/client already may suffer from a breaking change -- This might be Okayish if you raise the major version for this change

Both lists may not be complete, just first thoughts from my side.

What do you think about this?

@hansmi
Copy link
Owner

hansmi commented Feb 13, 2025

The hook-related code is relatively minor by now. I started in that area, then needed a client and for simplicity also added the flag-related code (primarily kpflag). The name stuck.

The Go documentation page finds no public importing packages besides my own (https://pkg.go.dev/github.com/hansmi/[email protected]/pkg/client?tab=importedby). I'm saying public because I personally have private code using the client and others may too. The effort for an extraction is not too bad, but is it worth it?

Overall I wouldn't mind extracting the API and flag-related code into a separate repository. It would be worth talking to the paperless-ngx project maintainers (@shamoon, @stumpylog, et al) to see if they'd be happy with a Go client repository within the project.

@shamoon
Copy link

shamoon commented Feb 13, 2025

Sorry, and I mean this with pure curiosity (no snark or whatever as can be sometimes the assumption on the web), but why would we house the client over there? We don’t currently maintain any of the third party clients and I don’t think either of us (obviously I don’t speak for stumpylog) are looking for more work to take on :)

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

No branches or pull requests

3 participants