From f9a3d5887e80cb9d1dad9b1a0687578395ee70f9 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Thu, 17 Aug 2023 18:36:09 +0200 Subject: [PATCH] Remove env variable usage --- pkg/plugin.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/plugin.go b/pkg/plugin.go index 89b278c..bfa9c3c 100644 --- a/pkg/plugin.go +++ b/pkg/plugin.go @@ -2,9 +2,9 @@ package main import ( "net/http" - "os" "github.com/alexanderzobnin/grafana-zabbix/pkg/datasource" + "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/log" "github.com/grafana/grafana-plugin-sdk-go/backend/resource/httpadapter" @@ -33,20 +33,11 @@ func main() { } func Init(logger log.Logger, mux *http.ServeMux) *datasource.ZabbixDatasource { - variableName := "GFX_ZABBIX_DATA_PATH" - path, exist := os.LookupEnv(variableName) - if !exist { - logger.Debug("Could not read environment variable", variableName) - } else { - logger.Debug("Environment variable for storage found", "variable", variableName, "value", path) - } - ds := datasource.NewZabbixDatasource() mux.HandleFunc("/", ds.RootHandler) mux.HandleFunc("/zabbix-api", ds.ZabbixAPIHandler) mux.HandleFunc("/db-connection-post", ds.DBConnectionPostProcessingHandler) - // mux.Handle("/scenarios", getScenariosHandler(logger)) return ds }