Documentation
¶
Index ¶
- type Config
- type Dashboard
- type DashboardData
- type DashboardMetadata
- type Instance
- type MockInstance
- func (_m *MockInstance) GetDashboard(ctx context.Context, uid string) (*Dashboard, error)
- func (_m *MockInstance) GetDashboardEmbed(ctx context.Context, dashboardID string, queryParameter string) ([]byte, error)
- func (_m *MockInstance) GetDashboardFile(ctx context.Context, file string) ([]byte, error)
- func (_m *MockInstance) GetDashboards(ctx context.Context, query string) ([]Dashboard, error)
- func (_m *MockInstance) GetName() string
- func (_m *MockInstance) Proxy(w http.ResponseWriter, r *http.Request, dashboardID string, ...)
- type NewMockInstanceT
- type ResponseError
- type SingleDashboardResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Address string `json:"address"`
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 MockInstance ¶
MockInstance is an autogenerated mock type for the Instance type
func NewMockInstance ¶
func NewMockInstance(t NewMockInstanceT) *MockInstance
NewMockInstance creates a new instance of MockInstance. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockInstance) GetDashboard ¶
GetDashboard provides a mock function with given fields: ctx, uid
func (*MockInstance) GetDashboardEmbed ¶
func (_m *MockInstance) GetDashboardEmbed(ctx context.Context, dashboardID string, queryParameter string) ([]byte, error)
GetDashboardEmbed provides a mock function with given fields: ctx, dashboardID, queryParameter
func (*MockInstance) GetDashboardFile ¶
GetDashboardFile provides a mock function with given fields: ctx, file
func (*MockInstance) GetDashboards ¶
GetDashboards provides a mock function with given fields: ctx, query
func (*MockInstance) GetName ¶
func (_m *MockInstance) GetName() string
GetName provides a mock function with given fields:
func (*MockInstance) Proxy ¶
func (_m *MockInstance) Proxy(w http.ResponseWriter, r *http.Request, dashboardID string, queryParameter string)
Proxy provides a mock function with given fields: w, r, dashboardID, queryParameter
type NewMockInstanceT ¶
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.