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
- func FindGoBinary() (string, error)
- func FindNodeBinary() (string, error)
- func FindPnpmBinary() (string, error)
- func HydrateBuildOpts(opts *types.BuildOpts) error
- func PrepareCommandWithBinaries(command string, args []string, binaries ...string) (*exec.Cmd, error)
- type LoadPluginOptions
- type Manager
- type PluginBuilder
Constants ¶
const ( PluginInstallStart = "plugin/install_start" PluginDevInstallEventStart = "plugin/dev_install_start" PluginDevInstallEventError = "plugin/dev_install_error" PluginDevInstallEventComplete = "plugin/dev_install_complete" PluginReloadEventStart = "plugin/dev_reload_start" PluginReloadEventError = "plugin/dev_reload_error" PluginReloadEventComplete = "plugin/dev_reload_complete" )
const ( MaxPluginSize = 1024 * 1024 * 1024 // 1GB PluginUpdateStartedEvent = "plugin/update_started" PluginInstallStartedEvent = "plugin/install_started" PluginInstallFinishedEvent = "plugin/install_finished" PluginInstallErrorEvent = "plugin/install_error" )
const (
DedupInterval = 500 * time.Millisecond
)
Variables ¶
This section is empty.
Functions ¶
func CopyDirectory ¶
func CopySymLink ¶
func FindGoBinary ¶
FindGoBinary looks for the Go binary in a number of well-known paths in case it's not available in the PATH.
func FindNodeBinary ¶
FindNodeBinary tries to locate the Node.js binary across common install paths.
func FindPnpmBinary ¶
FindPnpmBinary looks for the Pnpm binary in a number of well-known paths in case it's not available in the PATH.
func HydrateBuildOpts ¶
HydrateBuildOpts adds the additional build options if they are not specified
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) // InstallPluginVersion installs a plugin with a specified version from the plugin registry. // It returns an error if it does not exist. InstallPluginVersion(pluginID string, version 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 // ListAvailablePlugins returns a list of all plugins that are available and suppported for the // users IDE environment. ListAvailablePlugins() ([]registry.Plugin, error) // 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, settingsProvider pkgsettings.Provider, registryClient *registry.RegistryClient, ) Manager
NewManager returns a new plugin manager for the IDE to use to manager installed plugins.
type PluginBuilder ¶
type PluginBuilder struct{}