Plugins: Refactor plugin download/installation (#43046)
* installer -> repo * add semver format checking * add plugin callbacks in test * remove newline * post install only scans new directories * remove unused stuff * everything in own package * add missing cli params * make grafana version part of the API * resolve conflicts * tidy up logger * fix cli and tidy log statements * rename log package * update struct name * fix linter issue * fs -> filestore * reorder imports * alias import * fix test * fix test * inline var * revert jsonc file * make repo dep of manager * actually inject the thing * accept all args for compatability checks * accept compat from store * pass os + arch vals * don't inject fs * tidy up * tidy up * merge with main and tidy fs storage * fix test * fix packages * fix comment + field name * update fs naming * fixed wire * remove unused func * fix mocks * fix storage test * renaming * fix log line * fix test * re-order field * tidying * add test for update with same version * fix wire for CLI * remove use of ioutil * don't pass field * small tidy * ignore code scanning warn * fix testdata link * update lgtm code
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package storage
|
||||
|
||||
import "fmt"
|
||||
|
||||
type ErrPermissionDenied struct {
|
||||
Path string
|
||||
}
|
||||
|
||||
func (e ErrPermissionDenied) Error() string {
|
||||
return fmt.Sprintf("could not create %q, permission denied, make sure you have write access to plugin dir", e.Path)
|
||||
}
|
||||
|
||||
type ExtractedPluginArchive struct {
|
||||
ID string
|
||||
Version string
|
||||
Dependencies []*Dependency
|
||||
Path string
|
||||
}
|
||||
|
||||
type Dependency struct {
|
||||
ID string
|
||||
Version string
|
||||
}
|
||||
|
||||
type InstalledPlugin struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
Info PluginInfo `json:"info"`
|
||||
Dependencies Dependencies `json:"dependencies"`
|
||||
}
|
||||
|
||||
type Dependencies struct {
|
||||
GrafanaVersion string `json:"grafanaVersion"`
|
||||
Plugins []PluginDependency `json:"plugins"`
|
||||
}
|
||||
|
||||
type PluginDependency struct {
|
||||
ID string `json:"id"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type PluginInfo struct {
|
||||
Version string `json:"version"`
|
||||
Updated string `json:"updated"`
|
||||
}
|
||||
Reference in New Issue
Block a user