Backend Plugins: (breaking change) Add PluginContext (#23788)
* breaking change for newer backend plugins * use exported protobuf converters and sdk types to reduce duplicate code * uses grafana-plugin-sdk-go@v0.54.0
This commit is contained in:
@@ -2,10 +2,6 @@ package backendplugin
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/genproto/pluginv2"
|
||||
)
|
||||
@@ -76,38 +72,6 @@ type CollectMetricsResult struct {
|
||||
PrometheusMetrics []byte
|
||||
}
|
||||
|
||||
type DataSourceConfig struct {
|
||||
ID int64
|
||||
Name string
|
||||
URL string
|
||||
User string
|
||||
Database string
|
||||
BasicAuthEnabled bool
|
||||
BasicAuthUser string
|
||||
JSONData *simplejson.Json
|
||||
DecryptedSecureJSONData map[string]string
|
||||
Updated time.Time
|
||||
}
|
||||
|
||||
type PluginConfig struct {
|
||||
OrgID int64
|
||||
PluginID string
|
||||
JSONData *simplejson.Json
|
||||
DecryptedSecureJSONData map[string]string
|
||||
Updated time.Time
|
||||
DataSourceConfig *DataSourceConfig
|
||||
}
|
||||
|
||||
type CallResourceRequest struct {
|
||||
Config PluginConfig
|
||||
Path string
|
||||
Method string
|
||||
URL string
|
||||
Headers map[string][]string
|
||||
Body []byte
|
||||
User *models.SignedInUser
|
||||
}
|
||||
|
||||
// CallResourceResult call resource result.
|
||||
type CallResourceResult struct {
|
||||
Status int
|
||||
|
||||
Reference in New Issue
Block a user