Documentation
¶
Overview ¶
Plugin manager used by the main application to load and invoke plugins.
Adapted from 'RPC-based plugins in Go' by Eli Bendersky (@eliben): ref: https://eli.thegreenplace.net/2023/rpc-based-plugins-in-go/ ref: https://github.com/eliben/code-for-blog/blob/main/2023/go-plugin-htmlize-rpc/plugin/manager.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager loads and manages Authorizer plugins for this application.
After creating a Manager value, call LoadPlugins with a directory path to discover and load plugins. At the end of the program call Close to kill and clean up all plugin processes.
func (*Manager) LoadPlugin ¶
LoadPlugins takes a directory path and assumes that all files within it are plugin binaries. It runs all these binaries in sub-processes, establishes RPC communication with the plugins, and registers them for the hooks they declare to support.