Backend plugins: Updates due to changes in SDK (#22649)
Use v0.20.0 of SDK
This commit is contained in:
committed by
GitHub
parent
805abdfa2a
commit
c12245bbb3
@@ -1,7 +1,6 @@
|
||||
package backendplugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend/plugin"
|
||||
@@ -10,7 +9,6 @@ import (
|
||||
|
||||
datasourceV1 "github.com/grafana/grafana-plugin-model/go/datasource"
|
||||
rendererV1 "github.com/grafana/grafana-plugin-model/go/renderer"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/genproto/pluginv2"
|
||||
goplugin "github.com/hashicorp/go-plugin"
|
||||
)
|
||||
|
||||
@@ -77,7 +75,8 @@ func NewBackendPluginDescriptor(pluginID, executablePath string, startFns Plugin
|
||||
},
|
||||
plugin.ProtocolVersion: {
|
||||
"diagnostics": &plugin.DiagnosticsGRPCPlugin{},
|
||||
"backend": &plugin.CoreGRPCPlugin{},
|
||||
"resource": &plugin.ResourceGRPCPlugin{},
|
||||
"data": &plugin.DataGRPCPlugin{},
|
||||
"transform": &plugin.TransformGRPCPlugin{},
|
||||
},
|
||||
},
|
||||
@@ -105,12 +104,16 @@ type DiagnosticsPlugin interface {
|
||||
plugin.DiagnosticsServer
|
||||
}
|
||||
|
||||
type CorePlugin interface {
|
||||
plugin.CoreClient
|
||||
type ResourcePlugin interface {
|
||||
plugin.ResourceClient
|
||||
}
|
||||
|
||||
type DataPlugin interface {
|
||||
plugin.DataClient
|
||||
}
|
||||
|
||||
type TransformPlugin interface {
|
||||
DataQuery(ctx context.Context, req *pluginv2.DataQueryRequest, callback plugin.TransformCallBack) (*pluginv2.DataQueryResponse, error)
|
||||
plugin.TransformClient
|
||||
}
|
||||
|
||||
// LegacyClient client for communicating with a plugin using the old plugin protocol.
|
||||
@@ -121,6 +124,7 @@ type LegacyClient struct {
|
||||
|
||||
// Client client for communicating with a plugin using the current plugin protocol.
|
||||
type Client struct {
|
||||
CorePlugin CorePlugin
|
||||
ResourcePlugin ResourcePlugin
|
||||
DataPlugin DataPlugin
|
||||
TransformPlugin TransformPlugin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user