Documentation ¶
Index ¶
Constants ¶
const ( From boundary = iota To )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { GetDashboard(dashName string) (Dashboard, error) GetPanelPng(p Panel, dashName string, t TimeRange) (io.ReadCloser, error) }
Client is a Grafana API client
func NewV4Client ¶
func NewV4Client(grafanaURL string, apiToken string, variables url.Values, sslCheck bool, gridLayout bool) Client
NewV4Client creates a new Grafana 4 Client. If apiToken is the empty string, authorization headers will be omitted from requests. variables are Grafana template variable url values of the form var-{name}={value}, e.g. var-host=dev
func NewV5Client ¶
func NewV5Client(grafanaURL string, apiToken string, variables url.Values, sslCheck bool, gridLayout bool) Client
NewV5Client creates a new Grafana 5 Client. If apiToken is the empty string, authorization headers will be omitted from requests. variables are Grafana template variable url values of the form var-{name}={value}, e.g. var-host=dev
type Dashboard ¶
type Dashboard struct { Title string Description string VariableValues string //Not present in the Grafana JSON structure. Enriched data passed used by the Tex templating Rows []Row Panels []Panel }
Dashboard represents a Grafana dashboard This is both used to unmarshal the dashbaord JSON into and then enriched (sanitize fields for TeX consumption and add VarialbeValues)
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 ¶
Panel represents a Grafana dashboard panel
func (Panel) IsPartialWidth ¶
func (Panel) IsSingleStat ¶
type TimeRange ¶
func NewTimeRange ¶
func (TimeRange) FromFormatted ¶
Formats Grafana 'From' time spec into absolute printable time
func (TimeRange) ToFormatted ¶
Formats Grafana 'To' time spec into absolute printable time