refactor: update imports in exporter.go

Remove unnecessary name from the textfile import.
Remove the sqlite3 dependency which is no longer required.
This commit is contained in:
Hector
2021-10-18 19:32:08 +01:00
parent f2cd6ebb7b
commit 4f2d8d9079
3 changed files with 3 additions and 7 deletions

View File

@ -3,12 +3,11 @@ package main
import (
"fail2ban-prometheus-exporter/cfg"
"fail2ban-prometheus-exporter/collector/f2b"
textfile2 "fail2ban-prometheus-exporter/collector/textfile"
"fail2ban-prometheus-exporter/collector/textfile"
"fmt"
"log"
"net/http"
_ "github.com/mattn/go-sqlite3"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
@ -44,7 +43,7 @@ func rootHtmlHandler(w http.ResponseWriter, r *http.Request) {
}
}
func metricHandler(w http.ResponseWriter, r *http.Request, collector *textfile2.Collector) {
func metricHandler(w http.ResponseWriter, r *http.Request, collector *textfile.Collector) {
promhttp.Handler().ServeHTTP(w, r)
collector.WriteTextFileMetrics(w, r)
}
@ -61,7 +60,7 @@ func main() {
f2bCollector := f2b.NewExporter(appSettings, version)
prometheus.MustRegister(f2bCollector)
textFileCollector := textfile2.NewCollector(appSettings)
textFileCollector := textfile.NewCollector(appSettings)
prometheus.MustRegister(textFileCollector)
http.HandleFunc("/", rootHtmlHandler)