From d4e7f8adb5873b467600cb1e8adcdbf878cdd22d Mon Sep 17 00:00:00 2001 From: ash Date: Tue, 28 Dec 2021 10:24:34 +0000 Subject: [PATCH] Moved newJar to auth --- auth.go | 10 ++++++++++ main.go | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) 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