mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 03:34:15 -06:00
687e79538b
This commit adds a pkg/services/screenshot package for taking and uploading screenshots of Grafana dashboards. It supports taking screenshots of both dashboards and individual panels within a dashboard, using the rendering service. The screenshot package has the following services, most of which can be composed: BrowserScreenshotService (Takes screenshots with headless Chrome) CachableScreenshotService (Caches screenshots taken with another service such as BrowserScreenshotService) NoopScreenshotService (A no-op screenshot service for tests) SingleFlightScreenshotService (Prevents duplicate screenshots when taking screenshots of the same dashboard or panel in parallel) ScreenshotUnavailableService (A screenshot service that returns ErrScreenshotsUnavailable) UploadingScreenshotService (A screenshot service that uploads taken screenshots) The screenshot package does not support wire dependency injection yet. ngalert constructs its own version of the service. See https://github.com/grafana/grafana/issues/49296 This PR also adds an ImageScreenshotService to ngAlert. This is used to take screenshots with a screenshotservice and then store their location reference for use by alert instances and notifiers.
51 lines
1.5 KiB
Go
51 lines
1.5 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: github.com/grafana/grafana/pkg/components/imguploader (interfaces: ImageUploader)
|
|
|
|
// Package imguploader is a generated GoMock package.
|
|
package imguploader
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
gomock "github.com/golang/mock/gomock"
|
|
)
|
|
|
|
// MockImageUploader is a mock of ImageUploader interface.
|
|
type MockImageUploader struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockImageUploaderMockRecorder
|
|
}
|
|
|
|
// MockImageUploaderMockRecorder is the mock recorder for MockImageUploader.
|
|
type MockImageUploaderMockRecorder struct {
|
|
mock *MockImageUploader
|
|
}
|
|
|
|
// NewMockImageUploader creates a new mock instance.
|
|
func NewMockImageUploader(ctrl *gomock.Controller) *MockImageUploader {
|
|
mock := &MockImageUploader{ctrl: ctrl}
|
|
mock.recorder = &MockImageUploaderMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockImageUploader) EXPECT() *MockImageUploaderMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// Upload mocks base method.
|
|
func (m *MockImageUploader) Upload(arg0 context.Context, arg1 string) (string, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Upload", arg0, arg1)
|
|
ret0, _ := ret[0].(string)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// Upload indicates an expected call of Upload.
|
|
func (mr *MockImageUploaderMockRecorder) Upload(arg0, arg1 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Upload", reflect.TypeOf((*MockImageUploader)(nil).Upload), arg0, arg1)
|
|
}
|