imaginary icon indicating copy to clipboard operation
imaginary copied to clipboard

Plugins support

Open h2non opened this issue 8 years ago • 3 comments

A proposal for an external plugin interface thanks to Go 1.8+ dynamic shared libraries:

Possible capabilities:

  • HTTP middleware based on http.Handler idiomatic interface.
  • HTTP server/mux instrumentation.
  • Before/After observer hooks.
  • Logging/Monitoring instrumentation

CLI usage:

imaginary -plugin middleware.so -plugin middleware2.so -p 9090

h2non avatar Oct 27 '17 13:10 h2non

I wonder if this should be part of Imaginary. I would love to see a clear module API in Imaginary, however it's easy to fork Imaginary and implement the features using the module API. This would keep Imaginary as an easy-to-deploy Image service.

If Imaginary has this modular shared-library support, I suspect it becomes a future headache, with Middleware priorities and conflicting tasks. I suppose that's manageable, but I'm curious if that's something you should want.

Alternative suggestions:

  • Start a new project for the modular image service project
  • Imaginary can be rewritten to be a product of this base-project, with "fixed" features (all Imaginary can do now, each in the form of a module). This makes sure that Imaginary enjoys the improvements in the base project, while staying "stable".
  • People can build their own modules on the "base" project
  • bimg would be used in the "base" project for image manipulation

This would keep Imaginary from becoming too complex.

Just my 2 cents.

Dynom avatar Nov 21 '17 10:11 Dynom

Like the idea, but also understand wanting to keep things simple. I'm personally interested in just swapping in and/or adding a custom smart cropping solution - I've trained some Haar cascades with OpenCV and was thinking of using something like https://github.com/hybridgroup/gocv

Any update here?

pathouse avatar Mar 24 '18 03:03 pathouse

Personally I'd love to do more with object detection and I think the ability to "smart crop" images, and have some control over it, is an interesting feature (for me) to have. Whether or not that's a requirement for a more modular Imaginary might, however, be a different topic.

I've started a different topic that we could use to dive into the topic of smart-cropping and responsibilities https://github.com/h2non/imaginary/issues/193.

Dynom avatar Mar 27 '18 09:03 Dynom