pluginindex

package
v0.15.1-0...-e5b4670 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 7 Imported by: 0

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 Plugin

type Plugin struct {
	Name string
	URL  string
}

Plugin represents a plugin listed on a plugin index.

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.

Jump to

Keyboard shortcuts

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