Plugins: Add Plugin FS abstraction (#63734)

* unexport pluginDir from dto

* first pass

* tidy

* naming + add mutex

* add dupe checking

* fix func typo

* interface + move logic from renderer

* remote finder

* remote signing

* fix tests

* tidy up

* tidy markdown logic

* split changes

* fix tests

* slim interface down

* fix status code

* tidy exec path func

* fixup

* undo changes

* remove unused func

* remove unused func

* fix goimports

* fetch remotely

* simultaneous support

* fix linter

* use var

* add exception for gosec warning

* fixup

* fix tests

* tidy

* rework cfg pattern

* simplify

* PR feedback

* fix dupe field

* remove g304 nolint

* apply PR feedback

* remove unnecessary gosec nolint

* fix finder loop and update comment

* fix map alloc

* fix test

* remove commented code
This commit is contained in:
Will Browne
2023-03-07 16:47:02 +01:00
committed by GitHub
parent 380138f57b
commit 68df83c86d
22 changed files with 1344 additions and 870 deletions
+18
View File
@@ -2,6 +2,7 @@ package plugins
import (
"context"
"io/fs"
"github.com/grafana/grafana-plugin-sdk-go/backend"
@@ -38,6 +39,23 @@ type UpdateInfo struct {
PluginZipURL string
}
type FS interface {
fs.FS
Base() string
Files() []string
}
type FoundBundle struct {
Primary FoundPlugin
Children []*FoundPlugin
}
type FoundPlugin struct {
JSONData JSONData
FS FS
}
// Client is used to communicate with backend plugin implementations.
type Client interface {
backend.QueryDataHandler