Open rnpridgeon opened 1 year ago
Using a first class function definition, as opposed to an interface, provides greater flexibility and reduces makes templating simpler.
If a plugin/template author wishes to use a struct to attach state to their function they are still free to do so.
It is not however possible currently to supply just a function matching the appropriate signature.
// The Plugin interface is all that needs to be implemented by an E2 Core plugin. type Plugin interface { Run(input []byte) ([]byte, error) }
to
type Plugin func(input []byte) ([]byte, error)
This also simplifies template handling on the builder side since we no longer have a hard dependency on the name and shape of the target plugin.
Lastly this arrangement would more closely align with the javascript and typescript sdk.
*This change should be applied to rust as well for the same reasons stated for tinygo
Using a first class function definition, as opposed to an interface, provides greater flexibility and reduces makes templating simpler.
If a plugin/template author wishes to use a struct to attach state to their function they are still free to do so.
It is not however possible currently to supply just a function matching the appropriate signature.
to
This also simplifies template handling on the builder side since we no longer have a hard dependency on the name and shape of the target plugin.
Lastly this arrangement would more closely align with the javascript and typescript sdk.