Documentation ¶
Overview ¶
Package pluginindex is a package that handles fetching plugin repo URLs by name for user convenience.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PluginIndex ¶
type PluginIndex struct {
// contains filtered or unexported fields
}
PluginIndex is a struct representing the user's preferences for plugin index and the plugin index on disk.
func Build ¶
func Build(dataDir string, URL string, disableUpdate bool, updateDurationMinutes int) PluginIndex
Build returns a complete PluginIndex struct with default values set
func New ¶
func New(directory, url string, disableUpdate bool, updateDurationMinutes int, repo git.Repoer) PluginIndex
New initializes a new PluginIndex instance with the options passed in.
func (PluginIndex) Get ¶
func (p PluginIndex) Get() (plugins []Plugin, err error)
Get returns a slice of all available plugins
func (PluginIndex) GetPluginSourceURL ¶
func (p PluginIndex) GetPluginSourceURL(name string) (string, error)
GetPluginSourceURL looks up a plugin by name and returns the repository URL for easy install by the user.
func (PluginIndex) Refresh ¶
func (p PluginIndex) Refresh() (bool, error)
Refresh may update the plugin repo if it hasn't been updated in longer than updateDurationMinutes. If the plugin repo needs to be updated the repo will be invoked to perform the actual Git pull.