Migrate to new backend sdk, use /zabbix-api endpoint for API queries

This commit is contained in:
Alexander Zobnin
2020-05-28 17:04:49 +03:00
parent 9f93faaebf
commit f0daa9fcb9
12 changed files with 478 additions and 141 deletions

View File

@@ -6,7 +6,7 @@ import (
"encoding/json"
"time"
"github.com/grafana/grafana_plugin_model/go/datasource"
"github.com/grafana/grafana-plugin-sdk-go/backend"
cache "github.com/patrickmn/go-cache"
)
@@ -40,7 +40,7 @@ func HashString(text string) string {
}
// HashDatasourceInfo converts the given datasource info to hash string
func HashDatasourceInfo(dsInfo *datasource.DatasourceInfo) string {
func HashDatasourceInfo(dsInfo *backend.DataSourceInstanceSettings) string {
digester := sha1.New()
if err := json.NewEncoder(digester).Encode(dsInfo); err != nil {
panic(err) // This shouldn't be possible but just in case DatasourceInfo changes