From 2410a2012875d9c964a2613b19e03b46c2df4f68 Mon Sep 17 00:00:00 2001 From: Scott Lepper Date: Mon, 13 Dec 2021 12:11:44 -0500 Subject: [PATCH] remove old settings (#14) --- pkg/plugin/settings.go | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/pkg/plugin/settings.go b/pkg/plugin/settings.go index eba440d6..5bc0b382 100644 --- a/pkg/plugin/settings.go +++ b/pkg/plugin/settings.go @@ -7,34 +7,6 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" ) -type ConnectionSettings struct { - User string `json:"user"` - Password string `json:"password"` - Path string `json:"path"` - Cert string `json:"cert"` - PrivateKey string `json:"privateKey"` - AuthType string `json:"authType"` -} - -func GetSettings(s backend.DataSourceInstanceSettings) (*ConnectionSettings, error) { - settings := &ConnectionSettings{} - if err := json.Unmarshal(s.JSONData, settings); err != nil { - return nil, err - } - - if val, ok := s.DecryptedSecureJSONData["password"]; ok { - settings.Password = val - } - if val, ok := s.DecryptedSecureJSONData["cert"]; ok { - settings.Cert = val - } - if val, ok := s.DecryptedSecureJSONData["privateKey"]; ok { - settings.PrivateKey = val - } - - return settings, nil -} - // Settings - data loaded from grafana settings database type Settings struct { Server string `json:"server,omitempty"`