Closed flashmob closed 7 years ago
This is a huge... YYYYYUGE... backend refactor!
The main idea is to break backend processing down to individual, reusable components. In a nutshell, you'll now be able to customize your backend by configuration, like so:
"process_line": "HeadersParser|Debugger|Hasher|Header|Compressor|Redis|MySql"
Tokens are separated by a pipe '|'. Each token is a component called a "Processor". When an email is processed, it goes through each component in a line, starting at the left and ending on the right.
How's this implemented? It's using a decorator pattern found here https://github.com/smaxwellstewart/golang-decorator-pattern The video was mind-blowing https://www.youtube.com/watch?v=xyDkyFjzFVc
Still need to finalize some things, clean up and determine which interfaces / values need to be public.
This is really cool! How stable would you say it currently is? Can I start using this in my own fork or better to wait until things are more stable?
Hi! Thanks for checking it out.
Looking forward to making a release soon.
Currently, this branch passes all the tests and is being tested on a live system too. Although lots of things may change, such as names of things - so no guarantee of stability until it's released :-)
Still todo:
Almost there!
Thanks @jordanschalm for the review - will be going through these today.
@jordanschalm still going through it (and fixing problems), marking the ones that are fixed. Just want to say thanks again. Your reviews are very thorough with lots of attention to detail! Will have the new README ready for review soon too.
Worked on adding the pooling of notifyMsg chans. Now working on another optimization: In ValidateRcpt
, don't need to place on the channel if we know that there were no validators set in the config.
@jordanschalm Here is the new README ready for review - https://github.com/flashmob/go-guerrilla/blob/more-backends-refactoring/README.md - things to check: typos, grammar & flow. Also feedback on if it's using the right words to describe things. Thanks!
@dvcrn @peterkrejci @mrcpvn @eliezedeck Doing some final testing on this PR. If all good - to be merged to master today!
@flashmob amazing 😄 fantastic job!
Edit: deleted comment as no longer relevant! See new comment