plugin

package
v1.0.44 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: GPL-3.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsurePluginDirectoryPermissions

func EnsurePluginDirectoryPermissions(logger *logger.RateLimitedLogger) error

EnsurePluginDirectoryPermissions ensures that the plugins directory has the correct permissions and ownership Without this, we'll see logs like this (which effectively means the plugin is not loaded): WARN <plugin/manager.go:222> Failed to load plugin name=hello-world error="failed to start plugin process: fork/exec /Users/alechp/.ssot/gitspace/plugins/hello-world/hello-world: permission denied"

func HandleInstallPlugin

func HandleInstallPlugin(logger *logger.RateLimitedLogger, manager *Manager) error

func HandleListInstalledPlugins

func HandleListInstalledPlugins(logger *logger.RateLimitedLogger) error

func HandleRunPlugin

func HandleRunPlugin(logger *logger.RateLimitedLogger, manager *Manager) error

gitspace/handler.go

func HandleUninstallPlugin

func HandleUninstallPlugin(logger *logger.RateLimitedLogger, manager *Manager) error

func InstallPlugin

func InstallPlugin(logger *logger.RateLimitedLogger, manager *Manager, source string) error

func ListInstalledPlugins

func ListInstalledPlugins(logger *logger.RateLimitedLogger) ([]string, error)

func UninstallPlugin

func UninstallPlugin(logger *logger.RateLimitedLogger, name string) error

Types

type CatalogPlugin

type CatalogPlugin struct {
	Path string
}

type GitspaceCatalog

type GitspaceCatalog struct {
	Catalog struct {
		Name        string `toml:"name"`
		Description string `toml:"description"`
		Version     string `toml:"version"`
		LastUpdated struct {
			Date       string `toml:"date"`
			CommitHash string `toml:"commit_hash"`
		} `toml:"last_updated"`
	} `toml:"catalog"`
	Plugins   map[string]Plugin   `toml:"plugins"`
	Templates map[string]Template `toml:"templates"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(l *logger.RateLimitedLogger) *Manager

func (*Manager) AddDiscoveredPlugin

func (m *Manager) AddDiscoveredPlugin(name, path string)

func (*Manager) DiscoverPlugins

func (m *Manager) DiscoverPlugins() error

func (*Manager) ExecuteCommand

func (m *Manager) ExecuteCommand(pluginName, command string, params map[string]string) (string, error)

In gitspace/plugin/manager.go

func (*Manager) GetDiscoveredPlugins

func (m *Manager) GetDiscoveredPlugins() map[string]string

func (*Manager) GetLoadedPlugins

func (m *Manager) GetLoadedPlugins() map[string]*Plugin

func (*Manager) GetPluginMenu

func (m *Manager) GetPluginMenu(pluginName string) (*pb.MenuResponse, error)

func (*Manager) IsPluginLoaded

func (m *Manager) IsPluginLoaded(name string) bool

func (*Manager) LoadAllPlugins

func (m *Manager) LoadAllPlugins() error

func (*Manager) LoadPlugin

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

func (*Manager) UnloadPlugin

func (m *Manager) UnloadPlugin(name string) error

type Plugin

type Plugin struct {
	Name        string
	Path        string
	Version     string `toml:"version"`
	Description string `toml:"description"`
	Repository  struct {
		Type string `toml:"type"`
		URL  string `toml:"url"`
	} `toml:"repository"`
	// contains filtered or unexported fields
}

type PluginManifest

type PluginManifest struct {
	Metadata struct {
		Name        string `toml:"name"`
		Version     string `toml:"version"`
		Description string `toml:"description"`
	} `toml:"metadata"`
	Sources []struct {
		Path       string `toml:"path"`
		EntryPoint string `toml:"entry_point"`
	} `toml:"sources"`
}

type Template

type Template struct {
	Version     string `toml:"version,omitempty"`
	Description string `toml:"description,omitempty"`
	Path        string `toml:"path"`
	Repository  struct {
		Type string `toml:"type"`
		URL  string `toml:"url"`
	} `toml:"repository"`
}

Jump to

Keyboard shortcuts

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