The problem faced currently?
The worker sdk needs to manually provider the plugin details they wish to apply to their handlers. This leads to typos
How can we solve it?
spacectl client generate command will fetch the list of plugins from SC (Ref: [Feature] Add endpoint to return a list of available plugins. #1689 )
Each driver to implement a method named GeneratePlugins()
The output of GeneratePlugins() will be an exposed struct named Plugins with a member function for each plugin registered in SC.
The member function will be named as `<upperCamelCase(driver)><upperCamelCase(name)>
Example: if driver=opa; name=is-admin then name of function will be OpaIsAdmin()
Each function will return a struct named PluginDetails which implements a PluginImpl interface. This interface will have 3 methods:
Name() -> name of plugin
Driver() -> driver of plugin
Params() -> type any (will always be nil for now)
The output of this will be in a separate file named plugins.go
We want this support only for the golang and typescript drivers
If you want this feature to be implemented, give it a thumbs up reaction, so that we can determine which features are important to you.
👍
The problem faced currently?
The worker sdk needs to manually provider the plugin details they wish to apply to their handlers. This leads to typos
How can we solve it?
spacectl client generatecommand will fetch the list of plugins from SC (Ref: [Feature] Add endpoint to return a list of available plugins. #1689)GeneratePlugins()GeneratePlugins()will be an exposed struct namedPluginswith a member function for each plugin registered in SC.driver=opa; name=is-adminthen name of function will beOpaIsAdmin()PluginDetailswhich implements aPluginImplinterface. This interface will have 3 methods:nilfor now)plugins.go