Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateUserForm(settings dtos.AdminCreateUserForm) error
- func (c *Client) Dashboard(uri string) (*Dashboard, error)
- func (c *Client) DataSource(id int64) (*DataSource, error)
- func (c *Client) DeleteDashboard(slug string) error
- func (c *Client) DeleteDataSource(id int64) error
- func (c *Client) DeleteOrg(id int64) error
- func (c *Client) DeleteUser(id int64) error
- func (c *Client) DoRead(req *http.Request) ([]byte, error)
- func (c *Client) ListDashboards() (*DashboardList, error)
- func (c *Client) NewDataSource(s *DataSource) (int64, error)
- func (c *Client) NewOrg(name string) error
- func (c *Client) Orgs() ([]Org, error)
- func (c *Client) SaveDashboard(model map[string]interface{}, overwrite bool) (*DashboardSaveResponse, error)
- func (c *Client) UpdateDataSource(s *DataSource) error
- func (c *Client) Users() ([]User, error)
- type Dashboard
- type DashboardEntry
- type DashboardList
- type DashboardMeta
- type DashboardSaveResponse
- type DataSource
- type Org
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func New ¶
New creates a new grafana client auth can be in user:pass format, or it can be an api key
func (*Client) CreateUserForm ¶
func (c *Client) CreateUserForm(settings dtos.AdminCreateUserForm) error
func (*Client) Dashboard ¶
Dashboard fetches the dashboard with the given uri, and unmarshals it into a Dashboard structure. If uri does not contain a path then "db/" is prepended.
func (*Client) DataSource ¶
func (c *Client) DataSource(id int64) (*DataSource, error)
func (*Client) DeleteDashboard ¶
func (*Client) DeleteDataSource ¶
func (*Client) DeleteUser ¶
func (*Client) ListDashboards ¶
func (c *Client) ListDashboards() (*DashboardList, error)
func (*Client) NewDataSource ¶
func (c *Client) NewDataSource(s *DataSource) (int64, error)
func (*Client) SaveDashboard ¶
func (c *Client) SaveDashboard(model map[string]interface{}, overwrite bool) (*DashboardSaveResponse, error)
func (*Client) UpdateDataSource ¶
func (c *Client) UpdateDataSource(s *DataSource) error
type Dashboard ¶
type Dashboard struct { Meta DashboardMeta `json:"meta"` Model map[string]interface{} `json:"dashboard"` }
type DashboardEntry ¶
type DashboardList ¶
type DashboardList []DashboardEntry
type DashboardMeta ¶
type DashboardSaveResponse ¶
type DataSource ¶
type DataSource struct { Id int64 `json:"id,omitempty"` Name string `json:"name"` Type string `json:"type"` URL string `json:"url"` Access string `json:"access"` Database string `json:"database,omitempty"` User string `json:"user,omitempty"` Password string `json:"password,omitempty"` OrgId int64 `json:"orgId,omitempty"` IsDefault bool `json:"isDefault"` BasicAuth bool `json:"basicAuth"` BasicAuthUser string `json:"basicAuthUser,omitempty"` BasicAuthPassword string `json:"basicAuthPassword,omitempty"` }
Click to show internal directories.
Click to hide internal directories.