Refactor command modules to use dependency injection of required parameters for command handlers #27
Labels
advanced
An advanced enhancement requiring deep knowledge of the codebase and/or a particular topic
At the moment, HandlerFunc accepts a parameter that implements the
EchoVault
interafce. This causes the command modules to depend on the the echovault package, forcing the command modules to be placed in thepkg
folder which is not idea.The fix is to use Inversion of control to pass in all the functions, context, command and connection needed by the command handler, thus removing the dependence on the echovault package in any of the command modules.
This fix should also allow us to move the modules folder from
/pkg
to/internal
. It should also make it easier to implement shared object file extension of echovault commands.The text was updated successfully, but these errors were encountered: