Moved newJar to auth
This commit is contained in:
parent
f54bb612a9
commit
d4e7f8adb5
10
auth.go
10
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
|
||||
|
10
main.go
10
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
|
||||
|
Loading…
Reference in New Issue
Block a user