This release adds a major functionality: function plugins
Functions as Plugins
with the @plugin
decorator, you can expose functions as plugins. They will be wrapped by the framework
into FunctionPlugin
instances, which satisfy both the contract of a Plugin, and that of the function.
from plugin import plugin
@plugin(namespace="localstack.configurators")
def configure_logging(runtime):
logging.basicConfig(level=runtime.config.loglevel)
@plugin(namespace="localstack.configurators")
def configure_somethingelse(runtime):
# do other stuff with the runtime object
pass
With a PluginManager via load_all
, you receive the FunctionPlugin
instances, that you can call like the functions
runtime = LocalstackRuntime()
for configurator in PluginManager("localstack.configurators").load_all():
configurator(runtime)
Source code(tar.gz)
Source code(zip)