pluginmanager

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 6 Imported by: 0

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) Client

func (m *Manager) Client(path string) (pluginapi.Authorize, error)

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) LoadPlugin

func (m *Manager) LoadPlugin(path string) error

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.

Jump to

Keyboard shortcuts

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