Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Name string `json:"name"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
Home bool `json:"home"`
InternalAddress string `json:"internalAddress"`
PublicAddress string `json:"publicAddress"`
Username string `json:"username"`
Password string `json:"password"`
Token string `json:"token"`
}
Config is the structure of the configuration for a single Grafana instance.
type Dashboard ¶
type Dashboard struct {
DashboardData
DashboardMetadata
Type string `json:"type,omitempty"`
}
Dashboard is the structure of a single Grafana dashboard. It contains the dashboard data and metadata. If this is used via the search API it also contains a type field, because the API also returns folders.
type DashboardData ¶
type DashboardData struct {
ID int `json:"id"`
UID string `json:"uid"`
Title string `json:"title"`
Tags []string `json:"tags"`
}
DashboardData is the structure for the dashbord data returned by the Grafana API.
type DashboardMetadata ¶
type DashboardMetadata struct {
URL string `json:"url"`
FolderID int `json:"folderId"`
FolderUID string `json:"folderUid"`
FolderTitle string `json:"folderTitle,omitempty"`
FolderURL string `json:"folderUrl,omitempty"`
}
DashboardMetadata contains the metadata of a dashboard returned by the Grafana API.
type Instance ¶
type Instance interface {
GetName() string
GetDashboards(ctx context.Context, query string) ([]Dashboard, error)
GetDashboard(ctx context.Context, uid string) (*Dashboard, error)
// contains filtered or unexported methods
}
Instance is the interface which must be implemented by each configured Grafana instance.
type MockInstance ¶ added in v0.8.0
MockInstance is an autogenerated mock type for the Instance type
func (*MockInstance) GetDashboard ¶ added in v0.8.0
GetDashboard provides a mock function with given fields: ctx, uid
func (*MockInstance) GetDashboards ¶ added in v0.8.0
GetDashboards provides a mock function with given fields: ctx, query
func (*MockInstance) GetName ¶ added in v0.8.0
func (_m *MockInstance) GetName() string
GetName provides a mock function with given fields:
type ResponseError ¶
type ResponseError struct {
Message string `json:"message"`
}
ResponseError is the structure of failed Grafana API call.
type SingleDashboardResponse ¶
type SingleDashboardResponse struct {
Dashboard DashboardData `json:"dashboard"`
Metadata DashboardMetadata `json:"meta"`
}
SingleDashboardResponse is the structure of the data returned by the Grafana API to get a dashboard by its uid.