Skip to content

Commit

Permalink
remove old settings (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Lepper authored Dec 13, 2021
1 parent 71f8438 commit 2410a20
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions pkg/plugin/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit 2410a20

Please sign in to comment.