Minor style fixes

This commit is contained in:
Conrad Hoffmann 2018-09-21 11:41:59 +02:00
parent 2c927eb68e
commit 1e16da97c1
2 changed files with 6 additions and 5 deletions

View File

@ -21,9 +21,10 @@ import (
"github.com/prometheus/common/log"
)
const namespace = "ipmi"
const targetLocal = ""
const (
namespace = "ipmi"
targetLocal = ""
)
var (
ipmiDCMICurrentPowerRegex = regexp.MustCompile(`^Current Power\s*:\s*(?P<value>[0-9.]*)\s*Watts.*`)

View File

@ -34,7 +34,7 @@ var (
reloadCh chan chan error
)
func remoteIpmiHandler(w http.ResponseWriter, r *http.Request) {
func remoteIPMIHandler(w http.ResponseWriter, r *http.Request) {
target := r.URL.Query().Get("target")
if target == "" {
http.Error(w, "'target' parameter must be specified", 400)
@ -98,7 +98,7 @@ func main() {
prometheus.MustRegister(&localCollector)
http.Handle("/metrics", promhttp.Handler()) // Regular metrics endpoint for local IPMI metrics.
http.HandleFunc("/ipmi", remoteIpmiHandler) // Endpoint to do IPMI scrapes.
http.HandleFunc("/ipmi", remoteIPMIHandler) // Endpoint to do IPMI scrapes.
http.HandleFunc("/-/reload", updateConfiguration) // Endpoint to reload configuration.
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {