plugin-demo

command module
v0.0.0-...-62bffe1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: MIT Imports: 12 Imported by: 0

README

Plugin Demo

asciicast

Demo

You can run this with go run -v -trimpath ./ in this directory:

  • Runs the module-compiler on the boilerplate, demo, and CLI controllers.
  • Executes the CLI pre-configured to load the demo plugins + controllers.
  • Exits a few seconds after successfully loading + executing

This is an end to end demo of plugin build + load via modules.

There are additional scripts to run the demo using the plugin CLI interface, and/or to run the codegen and stop.

Known Bugs

Unable to Unload Plugins

When a plugin is compiled, the "main" package is actually compiled to a module named "plugin/unnamed-hashstrhere" with a hash of the main file contents. This package is reloaded correctly because it has a unique name (unique ID).

However, this doesn't accomplish what we want. I actually want to re-load the package named "github.com/aperturerobotics/controllerbus/example/boilerplate". Since this package is already loaded, Go does not re-load it from the plugin.

This code already will automatically insert entropy into the main package contents to produce a unique plugin package ID. But this isn't enough, we need to clobber the old code in the module tables as well.

Loading plugins works great. Re-loading them: not quite yet.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL