config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SaToken = "saToken"

Variables

View Source
var DefaultConfig = Config{
	Theme:              "light",
	Orientation:        "portrait",
	Layout:             "simple",
	DashboardMode:      "default",
	TimeZone:           "",
	EncodedLogo:        "",
	MaxBrowserWorkers:  2,
	MaxRenderWorkers:   2,
	RequiredPermission: "Viewer",
	HTTPClientOptions: httpclient.Options{
		Timeouts: &httpclient.DefaultTimeoutOptions,
		TLS: &httpclient.TLSOptions{
			InsecureSkipVerify: false,
		},
	},
}

DefaultConfig Always start with a default config so that when the plugin is not provisioned with a config, we will still have "non-null" config to work with.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppURL             string `env:"GF_REPORTER_PLUGIN_APP_URL, overwrite"               json:"appUrl"`
	SkipTLSCheck       bool   `env:"GF_REPORTER_PLUGIN_SKIP_TLS_CHECK, overwrite"        json:"skipTlsCheck"`
	Theme              string `env:"GF_REPORTER_PLUGIN_REPORT_THEME, overwrite"          json:"theme"`
	Orientation        string `env:"GF_REPORTER_PLUGIN_REPORT_ORIENTATION, overwrite"    json:"orientation"`
	Layout             string `env:"GF_REPORTER_PLUGIN_REPORT_LAYOUT, overwrite"         json:"layout"`
	DashboardMode      string `env:"GF_REPORTER_PLUGIN_REPORT_DASHBOARD_MODE, overwrite" json:"dashboardMode"`
	TimeZone           string `env:"GF_REPORTER_PLUGIN_REPORT_TIMEZONE, overwrite"       json:"timeZone"`
	MaxBrowserWorkers  int    `env:"GF_REPORTER_PLUGIN_MAX_BROWSER_WORKERS, overwrite"   json:"maxBrowserWorkers"`
	MaxRenderWorkers   int    `env:"GF_REPORTER_PLUGIN_MAX_RENDER_WORKERS, overwrite"    json:"maxRenderWorkers"`
	RemoteChromeURL    string `env:"GF_REPORTER_PLUGIN_REMOTE_CHROME_URL, overwrite"     json:"remoteChromeUrl"`
	HeaderTemplate     string `env:"GF_REPORTER_PLUGIN_HEADER_TEMPLATE, overwrite"       json:"headerTemplate"`
	ReportTemplate     string `env:"GF_REPORTER_PLUGIN_REPORT_TEMPLATE, overwrite"       json:"reportTemplate"`
	FooterTemplate     string `env:"GF_REPORTER_PLUGIN_FOOTER_TEMPLATE, overwrite"       json:"footerTemplate"`
	RequiredPermission string `env:"GF_REPORTER_PLUGIN_REQUIRED_PERMISSION, overwrite"   json:"requiredPermission"`
	IncludePanelIDs    []int
	ExcludePanelIDs    []int

	// HTTP Client
	HTTPClientOptions httpclient.Options

	// Secrets
	Token string
}

Config contains plugin settings.

func Load

func Load(ctx context.Context, settings backend.AppInstanceSettings) (Config, error)

Load loads the plugin settings from data sent by provisioned config or from Grafana UI.

func (*Config) String

func (c *Config) String() string

String implements the stringer interface of Config.

Jump to

Keyboard shortcuts

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