Documentation
¶
Index ¶
Constants ¶
const ( From boundary = iota To )
const PLUGIN_NAME = "mahendrapaipuri-dashboardreporter-app"
Variables ¶
This section is empty.
Functions ¶
func NewApp ¶
func NewApp(ctx context.Context, settings backend.AppInstanceSettings) (instancemgmt.Instance, error)
NewApp creates a new example *App instance.
Types ¶
type App ¶
type App struct { backend.CallResourceHandler // contains filtered or unexported fields }
App is the backend plugin which can respond to api queries.
func (*App) CheckHealth ¶
func (a *App) CheckHealth(_ context.Context, _ *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
CheckHealth handles health checks sent from Grafana to the plugin.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Plugin config settings
type Dashboard ¶
type Dashboard struct { Title string `json:"title"` Description string `json:"description"` VariableValues string // Not present in the Grafana JSON structure. Enriched data passed used by the Tex templating RowOrPanels []RowOrPanel `json:"panels"` Panels []Panel }
Dashboard represents a Grafana dashboard This is both used to unmarshal the dashboard JSON into and then enriched (sanitize fields for TeX consumption and add VarialbeValues)
type GrafanaClient ¶
type GrafanaClient interface { GetDashboard(dashUID string) (Dashboard, error) GetPanelPNG(p Panel, dashUID string, t TimeRange) (io.ReadCloser, error) }
Client is a Grafana API client
func NewGrafanaClient ¶
func NewGrafanaClient( client *http.Client, grafanaAppURL string, headers http.Header, queryParams url.Values, layout string, dashboardMode string, ) GrafanaClient
NewClient creates a new Grafana Client. Cookies and Authorization headers, if found, will be forwarded in the requests queryParams are Grafana template variable url values of the form var-{name}={value}, e.g. var-host=dev
type GridPos ¶
type GridPos struct { H float64 `json:"h"` W float64 `json:"w"` X float64 `json:"x"` Y float64 `json:"y"` }
Panel represents a Grafana dashboard panel position
type Panel ¶
type Panel struct { Id int `json:"id"` Type string `json:"type"` Title string `json:"title"` GridPos GridPos `json:"gridPos"` }
Panel represents a Grafana dashboard panel
func (Panel) IsPartialWidth ¶
If panel has width less than total allowable width
type Report ¶
Report groups functions related to genrating the report. After reading and closing the pdf returned by Generate(), call Clean() to delete the pdf file as well the temporary build files
func NewReport ¶
func NewReport(logger log.Logger, client GrafanaClient, config *ReportConfig) (Report, error)
New creates a new Report.
type ReportConfig ¶
type ReportConfig struct {
// contains filtered or unexported fields
}
Report config
func (ReportConfig) IsLandscapeOrientation ¶
func (c ReportConfig) IsLandscapeOrientation() bool
Is orientation landscape?
type RowOrPanel ¶ added in v1.0.0
Row represents a container for Panels
type TimeRange ¶
func (TimeRange) FromFormatted ¶
Formats Grafana 'From' time spec into absolute printable time
func (TimeRange) ToFormatted ¶
Formats Grafana 'To' time spec into absolute printable time