installer

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchMeta

type ArchMeta struct {
	SHA256 string `json:"sha256"`
}

type Dependencies

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

type ErrVersionNotFound

type ErrVersionNotFound struct {
	PluginID         string
	RequestedVersion string
	SystemInfo       string
}

func (ErrVersionNotFound) Error

func (e ErrVersionNotFound) Error() string

type ErrVersionUnsupported

type ErrVersionUnsupported struct {
	PluginID         string
	RequestedVersion string
	SystemInfo       string
}

func (ErrVersionUnsupported) Error

func (e ErrVersionUnsupported) Error() string

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 Installer

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

func New

func New(skipTLSVerify bool, grafanaVersion string, logger Logger) *Installer

func (*Installer) DownloadFile

func (i *Installer) DownloadFile(pluginID string, tmpFile *os.File, url string, checksum string) (err error)

func (*Installer) GetUpdateInfo

func (i *Installer) GetUpdateInfo(ctx context.Context, pluginID, version, pluginRepoURL string) (plugins.UpdateInfo, error)

func (*Installer) Install

func (i *Installer) Install(ctx context.Context, pluginID, version, pluginsDir, pluginZipURL, pluginRepoURL string) error

Install downloads the plugin code as a zip file from specified URL and then extracts the zip into the provided plugins directory.

func (*Installer) Uninstall

func (i *Installer) Uninstall(ctx context.Context, pluginDir string) error

Uninstall removes the specified plugin from the provided plugin directory.

type Logger

type Logger interface {
	Successf(format string, args ...interface{})
	Failuref(format string, args ...interface{})

	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
}

type Plugin

type Plugin struct {
	ID       string    `json:"id"`
	Category string    `json:"category"`
	Versions []Version `json:"versions"`
}

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"`
}

type PluginRepo

type PluginRepo struct {
	Plugins []Plugin `json:"plugins"`
	Version string   `json:"version"`
}

type Response4xxError

type Response4xxError struct {
	Message    string
	StatusCode int
	SystemInfo string
}

func (Response4xxError) Error

func (e Response4xxError) Error() string

type Version

type Version struct {
	Commit  string              `json:"commit"`
	URL     string              `json:"url"`
	Version string              `json:"version"`
	Arch    map[string]ArchMeta `json:"arch"`
}

Jump to

Keyboard shortcuts

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