The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/thumbs/dummy.go

64 lines
1.8 KiB

package thumbs
import (
"context"
"net/http"
"github.com/grafana/grafana/pkg/api/response"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
)
// When the feature flag is not enabled we just implement a dummy service
type dummyService struct{}
func (ds *dummyService) GetUsageStats(ctx context.Context) map[string]interface{} {
return make(map[string]interface{})
}
func (ds *dummyService) GetImage(c *contextmodel.ReqContext) {
c.JSON(400, map[string]string{"error": "invalid size"})
}
func (ds *dummyService) UpdateThumbnailState(c *contextmodel.ReqContext) {
c.JSON(400, map[string]string{"error": "invalid size"})
}
func (ds *dummyService) SetImage(c *contextmodel.ReqContext) {
c.JSON(400, map[string]string{"error": "invalid size"})
}
func (ds *dummyService) Enabled() bool {
return false
}
func (ds *dummyService) GetDashboardPreviewsSetupSettings(c *contextmodel.ReqContext) dashboardPreviewsSetupConfig {
return dashboardPreviewsSetupConfig{
SystemRequirements: dashboardPreviewsSystemRequirements{
Met: false,
RequiredImageRendererPluginVersion: "",
},
ThumbnailsExist: false,
}
}
func (ds *dummyService) StartCrawler(c *contextmodel.ReqContext) response.Response {
result := make(map[string]string)
result["error"] = "Not enabled"
return response.JSON(http.StatusOK, result)
}
func (ds *dummyService) StopCrawler(c *contextmodel.ReqContext) response.Response {
result := make(map[string]string)
result["error"] = "Not enabled"
return response.JSON(http.StatusOK, result)
}
func (ds *dummyService) CrawlerStatus(c *contextmodel.ReqContext) response.Response {
result := make(map[string]string)
result["error"] = "Not enabled"
return response.JSON(http.StatusOK, result)
}
func (ds *dummyService) Run(ctx context.Context) error {
return nil
}