Documentation ¶
Index ¶
- Constants
- func Copy(srcFile, dstFile string) error
- func CopyDir(dst, src string) error
- func CopyDirectory(scrDir, dest string) error
- func CopySymLink(source, dest string) error
- func CreateIfNotExists(dir string, perm os.FileMode) error
- func Exists(filePath string) bool
- type LoadPluginOptions
- type Manager
Constants ¶
View Source
const ( PluginDevInstallEventStart = "plugin/dev_install_start" PluginReloadEventStart = "plugin/dev_reload_start" PluginReloadEventError = "plugin/dev_reload_error" PluginReloadEventComplete = "plugin/dev_reload_complete" )
View Source
const ( MaxPluginSize = 1024 * 1024 * 1024 // 1GB PluginInstallStartedEvent = "plugin/install_started" )
View Source
const (
DedupInterval = 500 * time.Millisecond
)
Variables ¶
This section is empty.
Functions ¶
func CopyDirectory ¶
func CopySymLink ¶
Types ¶
type LoadPluginOptions ¶
type LoadPluginOptions struct { DevMode bool DevModePath string ExistingState *plugintypes.PluginState }
type Manager ¶
type Manager interface { // Initialize discovers and loads all plugins that are currently installed in the plugin directory, // and initializes them with the appropriate controllers. Initialize(ctx context.Context) error // Run starts until the the passed in context is cancelled Run(ctx context.Context) // Shutdown stops the plugin manager and all plugins. Shutdown() // InstallInDevMode installs a plugin from the given path, and sets up a watcher to recompile and reload the plugin // when changes are detected. Will prompt the user for a path. InstallInDevMode() (*config.PluginMeta, error) // InstallFromPathPrompt installs a plugin from the given path, prompting the user for the location // with a window dialog. InstallFromPathPrompt() (*config.PluginMeta, error) // InstallPluginFromPath installs a plugin from the given path. It will validate the plugin // and then load it into the manager. InstallPluginFromPath(path string) (*config.PluginMeta, error) // LoadPlugin loads a plugin at the given path. It will validate the plugin // and then load it into the manager. LoadPlugin(id string, opts *LoadPluginOptions) (types.Plugin, error) // ReloadPlugin reloads a plugin at the given path. It will validate the plugin // and then load it into the manager. ReloadPlugin(id string) (types.Plugin, error) // UninstallPlugin uninstalls a plugin from the manager, and removes it from the filesystem. UninstallPlugin(id string) (types.Plugin, error) // GetPlugin returns the plugin with the given plugin ID. GetPlugin(id string) (types.Plugin, error) // ListPlugins returns a list of all plugins that are currently registered with the manager. ListPlugins() []types.Plugin // GetPluginMeta returns the plugin metadata for the given plugin ID. GetPluginMeta(id string) (config.PluginMeta, error) // ListPlugins returns a list of all plugins that are currently registered with the manager. ListPluginMetas() []config.PluginMeta }
Manager manages the lifecycle and registration of plugins. It is responsible for registering and unregistering plugins, and communicating with the plugin controllers to handle the lifecycle of the plugins.
func NewManager ¶
func NewManager( logger *zap.SugaredLogger, resourceController resource.Controller, settingsController settings.Controller, execController pluginexec.Controller, networkerController networker.Controller, managers map[string]plugintypes.PluginManager, ) Manager
NewManager returns a new plugin manager for the IDE to use to manager installed plugins.
Click to show internal directories.
Click to hide internal directories.