storage

package
v0.0.0-testrgm4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUninstallOutsideOfPluginDir = errors.New("cannot uninstall a plugin outside of the plugins directory")
	ErrUninstallInvalidPluginDir   = errors.New("cannot recognize as plugin folder")
)

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	GrafanaVersion string             `json:"grafanaVersion"`
	Plugins        []PluginDependency `json:"plugins"`
}

type Dependency

type Dependency struct {
	ID      string
	Version string
}

type ErrPermissionDenied

type ErrPermissionDenied struct {
	Path string
}

func (ErrPermissionDenied) Error

func (e ErrPermissionDenied) Error() string

type ExtractedPluginArchive

type ExtractedPluginArchive struct {
	ID           string
	Version      string
	Dependencies []*Dependency
	Path         string
}

type FS

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

func FileSystem

func FileSystem(logger log.PrettyLogger, pluginsDir string) *FS

func (*FS) Add

func (fs *FS) Add(ctx context.Context, pluginID string, pluginArchive *zip.ReadCloser) (
	*ExtractedPluginArchive, error)

func (*FS) Register

func (fs *FS) Register(_ context.Context, pluginID, pluginDir string) error

func (*FS) Remove

func (fs *FS) Remove(_ context.Context, pluginID string) error

type InstalledPlugin

type InstalledPlugin struct {
	ID           string       `json:"id"`
	Name         string       `json:"name"`
	Type         string       `json:"type"`
	Info         PluginInfo   `json:"info"`
	Dependencies Dependencies `json:"dependencies"`
}

type Manager

type Manager interface {
	Add(ctx context.Context, pluginID string, rc *zip.ReadCloser) (*ExtractedPluginArchive, error)
	Register(ctx context.Context, pluginID, pluginDir string) error
	Remove(ctx context.Context, pluginID string) error
}

type PluginDependency

type PluginDependency struct {
	ID      string `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

type PluginInfo

type PluginInfo struct {
	Version string `json:"version"`
	Updated string `json:"updated"`
}

Jump to

Keyboard shortcuts

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