diff --git a/auth.go b/auth.go index 6363e2e..01bf812 100644 --- a/auth.go +++ b/auth.go @@ -8,6 +8,7 @@ import ( "net/http" "net/http/cookiejar" "net/url" + "strings" ) type Auth struct { @@ -20,6 +21,15 @@ type Instance struct { Jar *cookiejar.Jar } +func newJar(hosts *Instance) bool { + for _, e := range hosts.Jar.Cookies(hosts.Url) { + if strings.Contains(e.Name, "AIROS_") { + return false + } + } + return true +} + func auth(e *Instance) { var auth Auth auth.Username = cfg.Username diff --git a/main.go b/main.go index 6627a5c..5a41a46 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,6 @@ import ( "io/ioutil" "log" "net/http" - "strings" "time" "github.com/prometheus/client_golang/prometheus" @@ -75,15 +74,6 @@ func genProm(stats []Stats) { } } -func newJar(hosts *Instance) bool { - for _, e := range hosts.Jar.Cookies(hosts.Url) { - if strings.Contains(e.Name, "AIROS_") { - return false - } - } - return true -} - func getStats(hosts *[]Instance) (stats []Stats) { for _, e := range *hosts { var stat Stats