plugins

package
v4.6.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PluginTypeApp        = "app"
	PluginTypeDatasource = "datasource"
	PluginTypePanel      = "panel"
	PluginTypeDashboard  = "dashboard"
)
View Source
var (
	DataSources  map[string]*DataSourcePlugin
	Panels       map[string]*PanelPlugin
	StaticRoutes []*PluginStaticRoute
	Apps         map[string]*AppPlugin
	Plugins      map[string]*PluginBase
	PluginTypes  map[string]interface{}

	GrafanaLatestVersion string
	GrafanaHasUpdate     bool
)

Functions

func GetPluginMarkdown

func GetPluginMarkdown(pluginId string, name string) ([]byte, error)

func GetPluginSettings

func GetPluginSettings(orgId int64) (map[string]*m.PluginSettingInfoDTO, error)

func ImportDashboard

func ImportDashboard(cmd *ImportDashboardCommand) error

func Init

func Init() error

func StartPluginUpdateChecker

func StartPluginUpdateChecker()

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, pluginDir string) error

type AppPluginCss

type AppPluginCss struct {
	Light string `json:"light"`
	Dark  string `json:"dark"`
}

type AppPluginRoute

type AppPluginRoute struct {
	Path      string                 `json:"path"`
	Method    string                 `json:"method"`
	ReqRole   models.RoleType        `json:"reqRole"`
	Url       string                 `json:"url"`
	Headers   []AppPluginRouteHeader `json:"headers"`
	TokenAuth *JwtTokenAuth          `json:"tokenAuth"`
}

type AppPluginRouteHeader

type AppPluginRouteHeader struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

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

type DataSourcePlugin

type DataSourcePlugin struct {
	FrontendPluginBase
	Annotations  bool              `json:"annotations"`
	Metrics      bool              `json:"metrics"`
	Alerting     bool              `json:"alerting"`
	QueryOptions map[string]bool   `json:"queryOptions,omitempty"`
	BuiltIn      bool              `json:"builtIn,omitempty"`
	Mixed        bool              `json:"mixed,omitempty"`
	HasQueryHelp bool              `json:"hasQueryHelp,omitempty"`
	Routes       []*AppPluginRoute `json:"routes"`
}

func (*DataSourcePlugin) Load

func (p *DataSourcePlugin) Load(decoder *json.Decoder, pluginDir string) 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 GithubLatest struct {
	Stable  string `json:"stable"`
	Testing string `json:"testing"`
}

type GrafanaNetPlugin

type GrafanaNetPlugin struct {
	Slug    string `json:"slug"`
	Version string `json:"version"`
}

type ImportDashboardCommand

type ImportDashboardCommand struct {
	Dashboard *simplejson.Json
	Path      string
	Inputs    []ImportDashboardInput
	Overwrite bool

	OrgId    int64
	UserId   int64
	PluginId string
	Result   *PluginDashboardInfoDTO
}

type ImportDashboardInput

type ImportDashboardInput struct {
	Type     string `json:"type"`
	PluginId string `json:"pluginId"`
	Name     string `json:"name"`
	Value    string `json:"value"`
}

type JwtTokenAuth

type JwtTokenAuth struct {
	Url    string            `json:"url"`
	Params map[string]string `json:"params"`
}

type PanelPlugin

type PanelPlugin struct {
	FrontendPluginBase
}

func (*PanelPlugin) Load

func (p *PanelPlugin) Load(decoder *json.Decoder, pluginDir string) 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"`
	HideFromList bool               `json:"hideFromList,omitempty"`
	State        string             `json:"state,omitempty"`

	IncludedInAppId string `json:"-"`
	PluginDir       string `json:"-"`
	DefaultNavUrl   string `json:"-"`
	IsCorePlugin    bool   `json:"-"`

	GrafanaNetVersion   string `json:"-"`
	GrafanaNetHasUpdate bool   `json:"-"`
}

type PluginDashboardInfoDTO

type PluginDashboardInfoDTO struct {
	PluginId         string `json:"pluginId"`
	Title            string `json:"title"`
	Imported         bool   `json:"imported"`
	ImportedUri      string `json:"importedUri"`
	Slug             string `json:"slug"`
	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 PluginDependencyItem struct {
	Type    string `json:"type"`
	Id      string `json:"id"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

type PluginInclude

type PluginInclude struct {
	Name       string     `json:"name"`
	Path       string     `json:"path"`
	Type       string     `json:"type"`
	Component  string     `json:"component"`
	Role       m.RoleType `json:"role"`
	AddToNav   bool       `json:"addToNav"`
	DefaultNav bool       `json:"defaultNav"`
	Slug       string     `json:"slug"`

	Id string `json:"-"`
}

type PluginInfo

type PluginInfo struct {
	Author      PluginInfoLink      `json:"author"`
	Description string              `json:"description"`
	Links       []PluginInfoLink    `json:"links"`
	Logos       PluginLogos         `json:"logos"`
	Screenshots []PluginScreenshots `json:"screenshots"`
	Version     string              `json:"version"`
	Updated     string              `json:"updated"`
}
type PluginInfoLink struct {
	Name string `json:"name"`
	Url  string `json:"url"`
}

type PluginLoader

type PluginLoader interface {
	Load(decoder *json.Decoder, pluginDir string) error
}

type PluginLogos

type PluginLogos struct {
	Small string `json:"small"`
	Large string `json:"large"`
}

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
}

type PluginScreenshots

type PluginScreenshots struct {
	Path string `json:"path"`
	Name string `json:"name"`
}

type PluginStaticRoute

type PluginStaticRoute struct {
	Directory string
	PluginId  string
}

Jump to

Keyboard shortcuts

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