mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user