mirror of
https://github.com/grafana/grafana.git
synced 2025-02-03 12:11:09 -06:00
725dbf8d95
* Add context to datasource service * Adjust wire for ShouldBeReported method * Replace inTransactionCtx
28 lines
848 B
Go
28 lines
848 B
Go
package usagestats
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type Report struct {
|
|
Version string `json:"version"`
|
|
Metrics map[string]interface{} `json:"metrics"`
|
|
Os string `json:"os"`
|
|
Arch string `json:"arch"`
|
|
Edition string `json:"edition"`
|
|
HasValidLicense bool `json:"hasValidLicense"`
|
|
Packaging string `json:"packaging"`
|
|
UsageStatsId string `json:"usageStatsId"`
|
|
}
|
|
|
|
type MetricsFunc func(context.Context) (map[string]interface{}, error)
|
|
|
|
type SendReportCallbackFunc func()
|
|
|
|
type Service interface {
|
|
GetUsageReport(context.Context) (Report, error)
|
|
RegisterMetricsFunc(MetricsFunc)
|
|
RegisterSendReportCallback(SendReportCallbackFunc)
|
|
ShouldBeReported(context.Context, string) bool
|
|
}
|