plugin

package
v0.0.0-...-6e90ae1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("plugin not found")

Functions

func InstalledVersion

func InstalledVersion(pluginName string, fs afero.Fs) (string, error)

InstalledVersion returns the current version of a plugin that is installed. Returns an ErrNotFound if the version is not found.

func InstalledVersionCmd

func InstalledVersionCmd(pluginName string, fs afero.Fs) tea.Cmd

InstalledVersionCmd returns a VersionMsg on success, a NotFoundMsg with the plugin name if the plugin isn't found, and an error on failure

func Remove

func Remove(pluginName string, fs afero.Fs) error

func RemoveCmd

func RemoveCmd(pluginName string, fs afero.Fs) tea.Cmd

func RemoveEntry

func RemoveEntry(pluginName string, fs afero.Fs) error

func RemoveEntryCmd

func RemoveEntryCmd(pluginName string, fs afero.Fs) tea.Cmd

func UpdateEntries

func UpdateEntries(entry Entry, fs afero.Fs) error

UpdateEntries updates the data of an entry if it exists, and adds an entry if it doesn't

func UpdateEntriesCmd

func UpdateEntriesCmd(entry Entry, fs afero.Fs) tea.Cmd

UpdateEntriesCmd returns an error on failure and a shared.SuccessMsg with contents "UpdateEntries" on success

Types

type Download

type Download struct {
	OS       string `json:"os" validate:"required"`
	Arch     string `json:"arch" validate:"required"`
	Url      string `json:"url" validate:"required,http_url"`
	Checksum string `json:"checksum"`
}

type Entry

type Entry struct {
	Name        string `json:"name" validate:"required"`
	Version     string `json:"version" validate:"required,semver"`
	MetadataUrl string `json:"metadataUrl" validate:"required,http_url"`
}

func GetEntries

func GetEntries(fs afero.Fs) ([]Entry, error)

GetEntries returns a list of installed plugins and an error and returns a nil slice if plugins.json is not present or if there is an error

type Metadata

type Metadata struct {
	Name      string     `json:"name" validate:"required"`
	Version   string     `json:"version" validate:"required,semver"`
	Downloads []Download `json:"downloads" validate:"required,dive"`
}

type NotFoundMsg

type NotFoundMsg struct {
	PluginName string
	Source     string
}

NotFoundMsg contains the name of the plugin that is not found

type VersionMsg

type VersionMsg string

VersionMsg contains the version that was found

Jump to

Keyboard shortcuts

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