plugins

package
v0.0.0-...-3ce8bff Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 23 Imported by: 0 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 FetchFeedback

func FetchFeedback(refresh bool) map[string]Feedback

FetchFeedback retrieves community upvotes, moderator status and directory metadata (version, icon, permissions, dates) from the directory API, reusing the last answer for feedbackMaxAge unless refresh is set. Best-effort: a failed fetch returns the last answer, or nil when there is none.

func IsFirstPartyRepo

func IsFirstPartyRepo(repo string) bool

Types

type Feedback

type Feedback struct {
	Upvotes     int
	Status      []string
	IssueURL    string
	Similar     []string
	Version     string
	Icon        string
	Permissions []string
	CreatedAt   string
	UpdatedAt   string
}

type GitClient

type GitClient interface {
	PlainClone(path string, url string) error
	Pull(path string) error
	OriginURL(path string) (string, error)
	HasUpdates(path string) (hasUpdates bool, localHash string, remoteHash string, err error)
	CurrentRevision(path string) (string, error)
	CheckoutRevision(path string, revision string) error
}

type LockStore

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

func NewLockStore

func NewLockStore(fs afero.Fs, path string) *LockStore

func (*LockStore) Exists

func (s *LockStore) Exists() (bool, error)

func (*LockStore) Load

func (s *LockStore) Load() (PluginLockfile, error)

func (*LockStore) Path

func (s *LockStore) Path() string

func (*LockStore) Write

func (s *LockStore) Write(lock PluginLockfile) error

type LockedPlugin

type LockedPlugin struct {
	Repo   string `json:"repo"`
	Path   string `json:"path,omitempty"`
	Commit string `json:"commit"`
}

type LyricsProvider

type LyricsProvider struct {
	Command string `json:"command"`
	Name    string `json:"name"`
	URL     string `json:"url"`
}

type Manager

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

func NewManager

func NewManager() (*Manager, error)

func NewManagerWithFs

func NewManagerWithFs(fs afero.Fs) (*Manager, error)

func (*Manager) EnsureLockfile

func (m *Manager) EnsureLockfile() error

func (*Manager) GetLockfilePath

func (m *Manager) GetLockfilePath() string

func (*Manager) GetPluginsDir

func (m *Manager) GetPluginsDir() string

func (*Manager) HasUpdates

func (m *Manager) HasUpdates(pluginID string, plugin Plugin) (hasUpdates bool, diffURL string, err error)

func (*Manager) Install

func (m *Manager) Install(plugin Plugin) error

func (*Manager) IsInstalled

func (m *Manager) IsInstalled(plugin Plugin) (bool, error)

func (*Manager) ListInstalled

func (m *Manager) ListInstalled() ([]string, error)

func (*Manager) LyricsProvider

func (m *Manager) LyricsProvider(pluginID string) (LyricsProvider, bool)

LyricsProvider reads an installed plugin's lyrics block, with Command made absolute.

func (*Manager) RestoreFromLockfile

func (m *Manager) RestoreFromLockfile(sourcePath string, prune bool) error

func (*Manager) SnapshotLockfile

func (m *Manager) SnapshotLockfile() (PluginLockfile, []string, error)

func (*Manager) Uninstall

func (m *Manager) Uninstall(plugin Plugin) error

func (*Manager) UninstallByIDOrName

func (m *Manager) UninstallByIDOrName(idOrName string) error

func (*Manager) Update

func (m *Manager) Update(plugin Plugin) error

func (*Manager) UpdateByIDOrName

func (m *Manager) UpdateByIDOrName(idOrName string) error

func (*Manager) WeatherProvider

func (m *Manager) WeatherProvider(pluginID string) (WeatherProvider, bool)

WeatherProvider reads an installed plugin's weather block, with Command made absolute.

func (*Manager) WriteCurrentLockfile

func (m *Manager) WriteCurrentLockfile(outputPath string) ([]string, error)

type Plugin

type Plugin struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	Capabilities []string `json:"capabilities"`
	Category     string   `json:"category"`
	Repo         string   `json:"repo"`
	Path         string   `json:"path,omitempty"`
	Author       string   `json:"author"`
	Description  string   `json:"description"`
	Dependencies []string `json:"dependencies,omitempty"`
	Compositors  []string `json:"compositors"`
	Distro       []string `json:"distro"`
	Screenshot   string   `json:"screenshot,omitempty"`
	RequiresDMS  string   `json:"requires_dms,omitempty"`
	Featured     bool     `json:"featured,omitempty"`
}

func FilterByCapability

func FilterByCapability(capability string, plugins []Plugin) []Plugin

func FilterByCategory

func FilterByCategory(category string, plugins []Plugin) []Plugin

func FilterByCompositor

func FilterByCompositor(compositor string, plugins []Plugin) []Plugin

func FindByIDOrName

func FindByIDOrName(idOrName string, plugins []Plugin) *Plugin

func FuzzySearch

func FuzzySearch(query string, plugins []Plugin) []Plugin

func SortByFirstParty

func SortByFirstParty(plugins []Plugin) []Plugin

type PluginLockfile

type PluginLockfile struct {
	LockfileVersion int                     `json:"lockfileVersion"`
	Plugins         map[string]LockedPlugin `json:"plugins"`
}

func NewPluginLockfile

func NewPluginLockfile() PluginLockfile

func ParsePluginLockfile

func ParsePluginLockfile(data []byte) (PluginLockfile, error)

func (PluginLockfile) Clone

func (lock PluginLockfile) Clone() PluginLockfile

func (PluginLockfile) IDs

func (lock PluginLockfile) IDs() []string

func (*PluginLockfile) SetRepositoryCommit

func (lock *PluginLockfile) SetRepositoryCommit(repo, commit string)

func (PluginLockfile) Validate

func (lock PluginLockfile) Validate() error

type Registry

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

func NewRegistry

func NewRegistry() (*Registry, error)

func NewRegistryWithFs

func NewRegistryWithFs(fs afero.Fs) (*Registry, error)

func (*Registry) Get

func (r *Registry) Get(idOrName string) (*Plugin, error)

func (*Registry) List

func (r *Registry) List() ([]Plugin, error)

func (*Registry) Refresh

func (r *Registry) Refresh() error

Refresh pulls every registry even when its clone is still fresh.

func (*Registry) Search

func (r *Registry) Search(query string) ([]Plugin, error)

func (*Registry) Update

func (r *Registry) Update() error

Update refreshes every configured registry, aggregating plugins in declaration order (first occurrence of an ID wins). A failing registry is reported in the joined error but does not block the others.

type WeatherProvider

type WeatherProvider struct {
	Command string `json:"command"`
	Name    string `json:"name"`
	URL     string `json:"url"`
}

Jump to

Keyboard shortcuts

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