Documentation ¶
Overview ¶
Package grafana contains a client implementation for obtaining data sources and dashboards from a grafana instance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
The Client type contains methods for interacting with the grafana instance.
func NewClient ¶
NewClient creates a new grafana client for the given url that authenticates using the given API key, returns an error if the health check fails.
func (*Client) IterateDashboards ¶
func (cl *Client) IterateDashboards(ctx context.Context, fn DashboardIterator) error
IterateDashboards searches for all dashboards in the grafana instance and invokes fn for each one. If fn returns an error or the context is cancelled iteration will stop.
func (*Client) IterateDataSources ¶
func (cl *Client) IterateDataSources(ctx context.Context, fn DataSourceIterator) error
IterateDataSources searches for all data sources in the grafana instance and invokes fn for each one. If fn returns an error or the context is cancelled iteration will stop.
type Dashboard ¶
type Dashboard struct {
// contains filtered or unexported fields
}
The Dashboard type is an io.Reader implementation that contains raw JSON representing the dashboard.
type DashboardIterator ¶
The DashboardIterator is a function that is invoked for each dashboard when using Client.IterateDashboards.
type DataSource ¶
type DataSource struct {
// contains filtered or unexported fields
}
The DataSource type is an io.Reader implementation that contains raw JSON representing the data source.
func (DataSource) ID ¶
func (d DataSource) ID() string
ID returns the unique ID for the data source.
type DataSourceIterator ¶
type DataSourceIterator func(ctx context.Context, d *DataSource) error
The DataSourceIterator is a function that is invoked for each dashboard when using Client.IterateDataSources.