2015-11-19 05:55:13 -06:00
|
|
|
package plugins
|
|
|
|
|
2015-12-21 10:23:24 -06:00
|
|
|
import (
|
2016-01-09 16:34:20 -06:00
|
|
|
"encoding/json"
|
2015-12-21 10:23:24 -06:00
|
|
|
)
|
2015-11-19 05:55:13 -06:00
|
|
|
|
2016-01-09 16:34:20 -06:00
|
|
|
type PluginLoader interface {
|
|
|
|
Load(decoder *json.Decoder, pluginDir string) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type PluginBase struct {
|
2016-01-19 11:18:53 -06:00
|
|
|
Type string `json:"type"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Id string `json:"id"`
|
|
|
|
Info PluginInfo `json:"info"`
|
|
|
|
|
|
|
|
IncludedInAppId string `json:"-"`
|
|
|
|
PluginDir string `json:"-"`
|
2016-01-08 16:15:44 -06:00
|
|
|
}
|
|
|
|
|
2015-12-22 09:32:17 -06:00
|
|
|
type PluginInfo struct {
|
2016-01-08 13:57:58 -06:00
|
|
|
Author PluginInfoLink `json:"author"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Links []PluginInfoLink `json:"links"`
|
|
|
|
Logos PluginLogos `json:"logos"`
|
2016-01-12 08:39:29 -06:00
|
|
|
Version string `json:"version"`
|
|
|
|
Updated string `json:"updated"`
|
2015-12-22 09:32:17 -06:00
|
|
|
}
|
|
|
|
|
2016-01-08 13:57:58 -06:00
|
|
|
type PluginInfoLink struct {
|
2015-12-22 09:32:17 -06:00
|
|
|
Name string `json:"name"`
|
|
|
|
Url string `json:"url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type PluginLogos struct {
|
|
|
|
Small string `json:"small"`
|
|
|
|
Large string `json:"large"`
|
|
|
|
}
|
|
|
|
|
2016-01-09 01:12:27 -06:00
|
|
|
type PluginStaticRoute struct {
|
|
|
|
Directory string
|
|
|
|
PluginId string
|
2015-11-19 09:50:17 -06:00
|
|
|
}
|
|
|
|
|
2015-12-03 01:52:37 -06:00
|
|
|
type EnabledPlugins struct {
|
2015-12-21 16:09:27 -06:00
|
|
|
Panels []*PanelPlugin
|
|
|
|
DataSources map[string]*DataSourcePlugin
|
|
|
|
Apps []*AppPlugin
|
2015-12-03 01:52:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewEnabledPlugins() EnabledPlugins {
|
|
|
|
return EnabledPlugins{
|
2015-12-21 16:09:27 -06:00
|
|
|
Panels: make([]*PanelPlugin, 0),
|
|
|
|
DataSources: make(map[string]*DataSourcePlugin),
|
|
|
|
Apps: make([]*AppPlugin, 0),
|
2015-12-03 01:52:37 -06:00
|
|
|
}
|
|
|
|
}
|