plugins

package
v0.0.0-...-df226ee Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 17 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
	Plugins      map[string]*PluginBase
	PluginTypes  map[string]interface{}
	StaticRoutes []*PluginStaticRoute
)

Functions

This section is empty.

Types

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       []*PluginRoute  `json:"routes"`
	Streaming    bool            `json:"streaming"`

	Executable string `json:"executable,omitempty"`
	SDK        bool   `json:"sdk,omitempty"`
}

type EnabledPlugins

type EnabledPlugins struct {
	Panels      []*PanelPlugin
	DataSources map[string]*DataSourcePlugin
}

func NewEnabledPlugins

func NewEnabledPlugins() EnabledPlugins

type FrontendPluginBase

type FrontendPluginBase struct {
	PluginBase
}

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, 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"`
	Category     string             `json:"category"`
	HideFromList bool               `json:"hideFromList,omitempty"`
	Preload      bool               `json:"preload"`
	State        PluginState        `json:"state,omitempty"`
	Signature    PluginSignature    `json:"signature"`

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

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

type PluginBuildInfo

type PluginBuildInfo struct {
	Time   int64  `json:"time,omitempty"`
	Repo   string `json:"repo,omitempty"`
	Branch string `json:"branch,omitempty"`
	Hash   string `json:"hash,omitempty"`
}

type PluginDependencies

type PluginDependencies struct {
	DatavVersion 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       models.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"`
	Build       PluginBuildInfo     `json:"build"`
	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 PluginManager

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

func (*PluginManager) Init

func (p *PluginManager) Init() error

type PluginNotFoundError

type PluginNotFoundError struct {
	PluginId string
}

func (PluginNotFoundError) Error

func (e PluginNotFoundError) Error() string

type PluginRoute

type PluginRoute struct {
	Path         string                `json:"path"`
	Method       string                `json:"method"`
	ReqRole      models.RoleType       `json:"reqRole"`
	URL          string                `json:"url"`
	URLParams    []PluginRouteURLParam `json:"urlParams"`
	Headers      []PluginRouteHeader   `json:"headers"`
	TokenAuth    *JwtTokenAuth         `json:"tokenAuth"`
	JwtTokenAuth *JwtTokenAuth         `json:"jwtTokenAuth"`
}

type PluginRouteHeader

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

PluginRouteHeader describes an HTTP header that is forwarded with the proxied request for a plugin route

type PluginRouteURLParam

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

PluginRouteURLParam describes query string parameters for a url in a plugin route

type PluginScanner

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

type PluginScreenshots

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

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 PluginStaticRoute struct {
	Directory string
	PluginId  string
}

Jump to

Keyboard shortcuts

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