Plugins: Add file store abstraction for handling plugin files (#65432)

* add file store

* fix markdown fetch bug

* add markdown tests

* fix var name
This commit is contained in:
Will Browne
2023-03-29 11:55:55 +01:00
committed by GitHub
parent 562d8dba5d
commit 7bbe255150
13 changed files with 212 additions and 189 deletions

View File

@@ -3,6 +3,7 @@ package plugins
import (
"context"
"io/fs"
"time"
"github.com/grafana/grafana-plugin-sdk-go/backend"
@@ -30,6 +31,16 @@ type PluginSource interface {
DefaultSignature(ctx context.Context) (Signature, bool)
}
type FileStore interface {
// File retrieves a plugin file.
File(ctx context.Context, pluginID, filename string) (*File, error)
}
type File struct {
Content []byte
ModTime time.Time
}
type CompatOpts struct {
GrafanaVersion string
OS string