grafana

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clientset

type Clientset struct {
	BaseUrl    *url.URL
	HTTPClient *http.Client
}

func (*Clientset) Dashboards

func (c *Clientset) Dashboards() DashboardsInterface

func (*Clientset) Datasources

func (c *Clientset) Datasources() DatasourcesInterface

type DashboardsClient

type DashboardsClient struct {
	BaseUrl    *url.URL
	HTTPClient *http.Client
}

func (*DashboardsClient) Create

func (c *DashboardsClient) Create(dashboardJson io.Reader) error

func (*DashboardsClient) Delete

func (c *DashboardsClient) Delete(slug string) error

func (*DashboardsClient) Search

func (c *DashboardsClient) Search() ([]GrafanaDashboard, error)

type DashboardsInterface

type DashboardsInterface interface {
	Search() ([]GrafanaDashboard, error)
	Create(dashboardJson io.Reader) error
	Delete(slug string) error
}

func NewDashboardsClient

func NewDashboardsClient(baseUrl *url.URL, c *http.Client) DashboardsInterface

type DatasourcesClient

type DatasourcesClient struct {
	BaseUrl    *url.URL
	HTTPClient *http.Client
}

DatasourcesClient is an implementation of the DatasourcesInterface. The datasources HTTP API of Grafana requires admin access.

func (*DatasourcesClient) All

func (*DatasourcesClient) Create

func (c *DatasourcesClient) Create(datasourceJson io.Reader) error

func (*DatasourcesClient) Delete

func (c *DatasourcesClient) Delete(id int) error

type DatasourcesInterface

type DatasourcesInterface interface {
	All() ([]GrafanaDatasource, error)
	Create(datasourceJson io.Reader) error
	Delete(id int) error
}

func NewDatasourcesClient

func NewDatasourcesClient(baseUrl *url.URL, c *http.Client) DatasourcesInterface

type GrafanaDashboard

type GrafanaDashboard struct {
	Id    int    `json:"id"`
	Title string `json:"title"`
	Uri   string `json:"uri"`
}

func (*GrafanaDashboard) Slug

func (d *GrafanaDashboard) Slug() string

type GrafanaDatasource

type GrafanaDatasource struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type Interface

type Interface interface {
	Dashboards() DashboardsInterface
	Datasources() DatasourcesInterface
}

func New

func New(baseUrl *url.URL) Interface

Jump to

Keyboard shortcuts

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