Plugins: Introduce Plugin Registry (#47200)

* introduce registry write/read separation

* internal + external registries

* fix tests

* fixup

* rename

* move interfaces

* back to plugins.Store

* fix registry name

* remove context.TODOs

* remove some ctx for now

* tidy

* remove dupe logic

* update naming

* move from manager.go to store

* amend logger name

* new store writer svc

* restrict changes

* more simplifying

* move interfaces around

* remove unused

* fix linter

* tidy

* add registry test

* fix tests

* revert testdata changes

* revert testdata changes #1

* revert testdata changes #2

* revert testdata changes #3

* revert testdata changes #4

* revert testdata changes #5

* revert testdata changes

* fixup testdata

* remove unused log

* update naming in test

* adjust ctx in test
This commit is contained in:
Will Browne
2022-06-03 13:06:27 +02:00
committed by GitHub
parent 6c7b6a7c34
commit 7536647ab6
15 changed files with 547 additions and 158 deletions
-16
View File
@@ -21,22 +21,6 @@ type Store interface {
Remove(ctx context.Context, pluginID string) error
}
// Loader is responsible for loading plugins from the file system.
type Loader interface {
// Load will return a list of plugins found in the provided file system paths.
Load(ctx context.Context, class Class, paths []string, ignore map[string]struct{}) ([]*Plugin, error)
}
// Installer is responsible for managing plugins (add / remove) on the file system.
type Installer interface {
// Install downloads the requested plugin in the provided file system location.
Install(ctx context.Context, pluginID, version, pluginsDir, pluginZipURL, pluginRepoURL string) error
// Uninstall removes the requested plugin from the provided file system location.
Uninstall(ctx context.Context, pluginDir string) error
// GetUpdateInfo provides update information for the requested plugin.
GetUpdateInfo(ctx context.Context, pluginID, version, pluginRepoURL string) (UpdateInfo, error)
}
type UpdateInfo struct {
PluginZipURL string
}