@grafana/create-plugin 2.0.0 → 2.0.1-canary.437.27b5da8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "2.0.0",
|
|
3
|
+
"version": "2.0.1-canary.437.27b5da8.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/create-plugin",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=18"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "27b5da896b0ab8c1987ef9ed30d9d1f3873c9a97"
|
|
70
70
|
}
|
|
@@ -16,7 +16,7 @@ import (
|
|
|
16
16
|
// since otherwise we will only get a not implemented error response from plugin in
|
|
17
17
|
// runtime. In this example datasource instance implements backend.QueryDataHandler,
|
|
18
18
|
// backend.CheckHealthHandler interfaces. Plugin should not implement all these
|
|
19
|
-
// interfaces- only those which are required for a particular task.
|
|
19
|
+
// interfaces - only those which are required for a particular task.
|
|
20
20
|
var (
|
|
21
21
|
_ backend.QueryDataHandler = (*Datasource)(nil)
|
|
22
22
|
_ backend.CheckHealthHandler = (*Datasource)(nil)
|
|
@@ -24,7 +24,7 @@ var (
|
|
|
24
24
|
)
|
|
25
25
|
|
|
26
26
|
// NewDatasource creates a new datasource instance.
|
|
27
|
-
func NewDatasource(_ backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
|
|
27
|
+
func NewDatasource(_ context.Context, _ backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
|
|
28
28
|
return &Datasource{}, nil
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -2,10 +2,11 @@ package plugin
|
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
4
|
"context"
|
|
5
|
+
"net/http"
|
|
6
|
+
|
|
5
7
|
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
|
6
8
|
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
|
|
7
9
|
"github.com/grafana/grafana-plugin-sdk-go/backend/resource/httpadapter"
|
|
8
|
-
"net/http"
|
|
9
10
|
)
|
|
10
11
|
|
|
11
12
|
// Make sure App implements required interfaces. This is important to do
|
|
@@ -24,7 +25,7 @@ type App struct {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
// NewApp creates a new example *App instance.
|
|
27
|
-
func NewApp(_ backend.AppInstanceSettings) (instancemgmt.Instance, error) {
|
|
28
|
+
func NewApp(_ context.Context, _ backend.AppInstanceSettings) (instancemgmt.Instance, error) {
|
|
28
29
|
var app App
|
|
29
30
|
|
|
30
31
|
// Use a httpadapter (provided by the SDK) for resource calls. This allows us
|
|
@@ -50,4 +51,3 @@ func (a *App) CheckHealth(_ context.Context, _ *backend.CheckHealthRequest) (*ba
|
|
|
50
51
|
Message: "ok",
|
|
51
52
|
}, nil
|
|
52
53
|
}
|
|
53
|
-
|