paranoia icon indicating copy to clipboard operation
paranoia copied to clipboard

Allow use as a Library

Open JamesLaverack opened this issue 3 years ago • 2 comments

Following a discussion on Slack there's a desire to make the APIs for Paranoia available for use. Presently they are in internal/ which forbids their use by other programs (convention by the Go compiler).

We have a few options:

  • Move all code currently under internal/ to pkg/, exposing all of it as an API surface.
  • Add new code under pkg/ that calls the implementation in internal/, exposing a more selected API surface.

The latter would be more work, but would expose an intentfully designed API instead of everything, which might make future code changes easier without breaking changes.

cc @mt-inside

JamesLaverack avatar Jan 03 '23 09:01 JamesLaverack

I'd definitely go with the 2nd option - a deliberately designed API. Loose coupled APIs will give so much more flexibility

cyberbliss avatar Jan 03 '23 10:01 cyberbliss

+1 to the above, contingent on us securing enough development effort to make progress on it in a timely fashion (i.e. completing it in weeks rather than months or years). If we can't and it's preventing potentially valuable use-cases then I'd say just expose the lot for now and let people have at it. Whilst not ideal I'd say it's better than blocking the code from being made use of.

AlexWootton avatar Jan 03 '23 10:01 AlexWootton