Documentation
¶
Overview ¶
Package plugin implements Nova's Lua-based plugin system. Plugins are .lua files discovered from ~/.nova/plugins/ that can hook into DNS resolution, VM lifecycle events, and network conditioning.
Index ¶
Constants ¶
const ( HookDNSResolve = "dns_resolve" // (hostname) -> ip or nil HookOnVMStart = "on_vm_start" // (vm_name) HookOnVMStop = "on_vm_stop" // (vm_name) HookOnSnapshot = "on_snapshot" // (snapshot_name) HookOnLink = "on_link" // (node_a, node_b, action) )
Hook points that plugins can register for.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager discovers, loads, and dispatches to Lua plugins.
func NewManager ¶
NewManager creates a plugin Manager that loads plugins from the given directory.
func (*Manager) CallHook ¶
CallHook dispatches a hook event to all loaded plugins that registered for it. Returns the first non-nil string result (useful for dns_resolve), or "".
func (*Manager) CallHookAll ¶
CallHookAll dispatches a hook to all plugins and collects all non-empty results.
func (*Manager) PluginCount ¶
PluginCount returns the number of loaded plugins.
func (*Manager) RegisterHostFunc ¶
func (m *Manager) RegisterHostFunc(name string, fn lua.LGFunction)
RegisterHostFunc adds a Go function that plugins can call via nova.<name>().