Documentation ¶
Index ¶
- Variables
- func ComposePluginStartCommand(executable string) string
- func GetPluginMarkdown(pluginId string, name string) ([]byte, error)
- func GetPluginSettings(orgId int64) (map[string]*models.PluginSettingInfoDTO, error)
- func ImportDashboard(cmd *ImportDashboardCommand) error
- func IsAppInstalled(pluginID string) bool
- type AppPlugin
- type AppPluginCss
- type AppPluginRoute
- type AppPluginRouteHeader
- type AppPluginRouteURLParam
- type DashTemplateEvaluator
- type DashboardInputMissingError
- type DataSourcePlugin
- type EnabledPlugins
- type FrontendPluginBase
- type GithubLatest
- type GrafanaNetPlugin
- type ImportDashboardCommand
- type ImportDashboardInput
- type JwtTokenAuth
- type PanelPlugin
- type PluginBase
- type PluginBuildInfo
- type PluginDashboardInfoDTO
- type PluginDependencies
- type PluginDependencyItem
- type PluginInclude
- type PluginInfo
- type PluginInfoLink
- type PluginLoader
- type PluginLogos
- type PluginManager
- type PluginNotFoundError
- type PluginScanner
- type PluginScreenshots
- type PluginSignature
- type PluginState
- type PluginStaticRoute
- type RendererPlugin
- type TransformPlugin
- type TransformWrapper
Constants ¶
This section is empty.
Variables ¶
var ( PluginTypeApp = "app" PluginTypeDatasource = "datasource" PluginTypePanel = "panel" PluginTypeDashboard = "dashboard" )
var ( DataSources map[string]*DataSourcePlugin Panels map[string]*PanelPlugin StaticRoutes []*PluginStaticRoute Apps map[string]*AppPlugin Plugins map[string]*PluginBase PluginTypes map[string]interface{} Renderer *RendererPlugin Transform *TransformPlugin GrafanaLatestVersion string GrafanaHasUpdate bool )
Functions ¶
func GetPluginSettings ¶
func GetPluginSettings(orgId int64) (map[string]*models.PluginSettingInfoDTO, error)
func ImportDashboard ¶
func ImportDashboard(cmd *ImportDashboardCommand) error
func IsAppInstalled ¶
IsAppInstalled checks if an app plugin with provided plugin ID is installed.
Types ¶
type AppPlugin ¶
type AppPlugin struct { FrontendPluginBase Routes []*AppPluginRoute `json:"routes"` FoundChildPlugins []*PluginInclude `json:"-"` Pinned bool `json:"-"` }
func (*AppPlugin) Load ¶
func (app *AppPlugin) Load(decoder *json.Decoder, base *PluginBase, backendPluginManager backendplugin.Manager) error
type AppPluginCss ¶
type AppPluginRoute ¶
type AppPluginRoute struct { Path string `json:"path"` Method string `json:"method"` ReqRole models.RoleType `json:"reqRole"` URL string `json:"url"` URLParams []AppPluginRouteURLParam `json:"urlParams"` Headers []AppPluginRouteHeader `json:"headers"` TokenAuth *JwtTokenAuth `json:"tokenAuth"` JwtTokenAuth *JwtTokenAuth `json:"jwtTokenAuth"` }
AppPluginRoute describes a plugin route that is defined in the plugin.json file for a plugin.
type AppPluginRouteHeader ¶
AppPluginRouteHeader describes an HTTP header that is forwarded with the proxied request for a plugin route
type AppPluginRouteURLParam ¶
AppPluginRouteURLParam describes query string parameters for a url in a plugin route
type DashTemplateEvaluator ¶
type DashTemplateEvaluator struct {
// contains filtered or unexported fields
}
func (*DashTemplateEvaluator) Eval ¶
func (this *DashTemplateEvaluator) Eval() (*simplejson.Json, error)
type DashboardInputMissingError ¶
type DashboardInputMissingError struct {
VariableName string
}
func (DashboardInputMissingError) Error ¶
func (e DashboardInputMissingError) Error() string
type DataSourcePlugin ¶
type DataSourcePlugin struct { FrontendPluginBase Annotations bool `json:"annotations"` Metrics bool `json:"metrics"` Alerting bool `json:"alerting"` Explore bool `json:"explore"` Table bool `json:"tables"` Logs bool `json:"logs"` Tracing bool `json:"tracing"` QueryOptions map[string]bool `json:"queryOptions,omitempty"` BuiltIn bool `json:"builtIn,omitempty"` Mixed bool `json:"mixed,omitempty"` Routes []*AppPluginRoute `json:"routes"` Streaming bool `json:"streaming"` Backend bool `json:"backend,omitempty"` Executable string `json:"executable,omitempty"` SDK bool `json:"sdk,omitempty"` }
DataSourcePlugin contains all metadata about a datasource plugin
func (*DataSourcePlugin) Load ¶
func (p *DataSourcePlugin) Load(decoder *json.Decoder, base *PluginBase, backendPluginManager backendplugin.Manager) error
type EnabledPlugins ¶
type EnabledPlugins struct { Panels []*PanelPlugin DataSources map[string]*DataSourcePlugin Apps []*AppPlugin }
func GetEnabledPlugins ¶
func GetEnabledPlugins(orgId int64) (*EnabledPlugins, error)
func NewEnabledPlugins ¶
func NewEnabledPlugins() EnabledPlugins
type FrontendPluginBase ¶
type FrontendPluginBase struct {
PluginBase
}
type GithubLatest ¶
type GrafanaNetPlugin ¶
type ImportDashboardCommand ¶
type ImportDashboardCommand struct { Dashboard *simplejson.Json Path string Inputs []ImportDashboardInput Overwrite bool FolderId int64 OrgId int64 User *models.SignedInUser PluginId string Result *PluginDashboardInfoDTO }
type ImportDashboardInput ¶
type JwtTokenAuth ¶
type JwtTokenAuth struct { Url string `json:"url"` Scopes []string `json:"scopes"` Params map[string]string `json:"params"` }
JwtTokenAuth struct is both for normal Token Auth and JWT Token Auth with an uploaded JWT file.
type PanelPlugin ¶
type PanelPlugin struct { FrontendPluginBase SkipDataQuery bool `json:"skipDataQuery"` }
func (*PanelPlugin) Load ¶
func (p *PanelPlugin) Load(decoder *json.Decoder, base *PluginBase, backendPluginManager backendplugin.Manager) error
type PluginBase ¶
type PluginBase struct { Type string `json:"type"` Name string `json:"name"` Id string `json:"id"` Info PluginInfo `json:"info"` Dependencies PluginDependencies `json:"dependencies"` Includes []*PluginInclude `json:"includes"` Module string `json:"module"` BaseUrl string `json:"baseUrl"` Category string `json:"category"` HideFromList bool `json:"hideFromList,omitempty"` Preload bool `json:"preload"` State PluginState `json:"state,omitempty"` Signature PluginSignature `json:"signature"` Backend bool `json:"backend"` IncludedInAppId string `json:"-"` PluginDir string `json:"-"` IsCorePlugin bool `json:"-"` GrafanaNetVersion string `json:"-"` GrafanaNetHasUpdate bool `json:"-"` Root *PluginBase }
PluginBase is the base plugin type.
type PluginBuildInfo ¶
type PluginDashboardInfoDTO ¶
type PluginDashboardInfoDTO struct { PluginId string `json:"pluginId"` Title string `json:"title"` Imported bool `json:"imported"` ImportedUri string `json:"importedUri"` ImportedUrl string `json:"importedUrl"` Slug string `json:"slug"` DashboardId int64 `json:"dashboardId"` FolderId int64 `json:"folderId"` ImportedRevision int64 `json:"importedRevision"` Revision int64 `json:"revision"` Description string `json:"description"` Path string `json:"path"` Removed bool `json:"removed"` }
func GetPluginDashboards ¶
func GetPluginDashboards(orgId int64, pluginId string) ([]*PluginDashboardInfoDTO, error)
type PluginDependencies ¶
type PluginDependencies struct { GrafanaVersion string `json:"grafanaVersion"` Plugins []PluginDependencyItem `json:"plugins"` }
type PluginDependencyItem ¶
type PluginInclude ¶
type PluginInfo ¶
type PluginInfo struct { Author PluginInfoLink `json:"author"` Description string `json:"description"` Links []PluginInfoLink `json:"links"` Logos PluginLogos `json:"logos"` Build PluginBuildInfo `json:"build"` Screenshots []PluginScreenshots `json:"screenshots"` Version string `json:"version"` Updated string `json:"updated"` }
type PluginInfoLink ¶
type PluginLoader ¶
type PluginLoader interface { // Load loads a plugin and registers it with the manager. Load(decoder *json.Decoder, base *PluginBase, backendPluginManager backendplugin.Manager) error }
PluginLoader can load a plugin.
type PluginLogos ¶
type PluginManager ¶
type PluginManager struct { BackendPluginManager backendplugin.Manager `inject:""` Cfg *setting.Cfg `inject:""` // contains filtered or unexported fields }
func (*PluginManager) GetDatasource ¶
func (pm *PluginManager) GetDatasource(pluginID string) (*DataSourcePlugin, bool)
GetDatasource returns a datasource based on passed pluginID if it exists
This function fetches the datasource from the global variable DataSources in this package. Rather then refactor all dependencies on the global variable we can use this as an transition.
func (*PluginManager) Init ¶
func (pm *PluginManager) Init() error
type PluginNotFoundError ¶
type PluginNotFoundError struct {
PluginId string
}
func (PluginNotFoundError) Error ¶
func (e PluginNotFoundError) Error() string
type PluginScanner ¶
type PluginScanner struct {
// contains filtered or unexported fields
}
func (*PluginScanner) IsBackendOnlyPlugin ¶
func (scanner *PluginScanner) IsBackendOnlyPlugin(pluginType string) bool
type PluginScreenshots ¶
type PluginSignature ¶
type PluginSignature string
const ( PluginSignatureInternal PluginSignature = "internal" // core plugin, no signature PluginSignatureValid PluginSignature = "valid" // signed and accurate MANIFEST PluginSignatureInvalid PluginSignature = "invalid" // invalid signature PluginSignatureModified PluginSignature = "modified" // valid signature, but content mismatch PluginSignatureUnsigned PluginSignature = "unsigned" // no MANIFEST file )
type PluginState ¶
type PluginState string
var ( PluginStateAlpha PluginState = "alpha" PluginStateBeta PluginState = "beta" )
type PluginStaticRoute ¶
type RendererPlugin ¶
type RendererPlugin struct { FrontendPluginBase Executable string `json:"executable,omitempty"` GrpcPluginV1 pluginModel.RendererPlugin GrpcPluginV2 pluginextensionv2.RendererPlugin // contains filtered or unexported fields }
func (*RendererPlugin) Load ¶
func (r *RendererPlugin) Load(decoder *json.Decoder, base *PluginBase, backendPluginManager backendplugin.Manager) error
type TransformPlugin ¶
type TransformPlugin struct { PluginBase Executable string `json:"executable,omitempty"` *TransformWrapper }
func (*TransformPlugin) Load ¶
func (p *TransformPlugin) Load(decoder *json.Decoder, base *PluginBase, backendPluginManager backendplugin.Manager) error
type TransformWrapper ¶
type TransformWrapper struct { sdkgrpcplugin.TransformClient // contains filtered or unexported fields }
func NewTransformWrapper ¶
func NewTransformWrapper(log log.Logger, plugin sdkgrpcplugin.TransformClient) *TransformWrapper