pluginInfo

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: GPL-3.0, GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetAllInstalledPluginsWithVersion = func() ([]PluginInfo, error) {
	pluginInstallPrefixes, err := common.GetPluginInstallPrefixes()
	if err != nil {
		return nil, err
	}
	allPlugins := make(map[string]PluginInfo, 0)
	for _, prefix := range pluginInstallPrefixes {
		files, err := ioutil.ReadDir(prefix)
		if err != nil {
			return nil, err
		}
		for _, file := range files {
			pluginDir, err := os.Stat(filepath.Join(prefix, file.Name()))
			if err != nil {
				continue
			}

			if !pluginDir.IsDir() {
				continue
			}
			latestPlugin, err := GetLatestInstalledPlugin(filepath.Join(prefix, file.Name()))
			if err != nil {
				continue
			}
			allPlugins[file.Name()] = *latestPlugin
		}
	}
	return sortPlugins(allPlugins), nil
}

GetAllInstalledPluginsWithVersion Fetches Latest version of all installed plugins.

Functions

This section is empty.

Types

type PluginInfo

type PluginInfo struct {
	Name    string
	Version *version.Version
	Path    string
}

func GetLatestInstalledPlugin

func GetLatestInstalledPlugin(pluginDir string) (*PluginInfo, error)

func GetPluginsInfo

func GetPluginsInfo() ([]PluginInfo, error)

Jump to

Keyboard shortcuts

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