This commit is contained in:
Locria Cyber 2023-10-03 12:08:50 +00:00
parent 0cb3224558
commit f23f7226f6
Signed by: iacore
GPG key ID: F8C16E5157A63006
5 changed files with 11 additions and 12 deletions

12
go.mod
View file

@ -2,17 +2,17 @@ module git.exozy.me/exozyme/status
go 1.21.1
require github.com/cbroglie/mustache v1.4.0
require maunium.net/go/mautrix v0.16.1
require github.com/pelletier/go-toml/v2 v2.1.0
require (
github.com/cbroglie/mustache v1.4.0
github.com/pelletier/go-toml/v2 v2.1.0
github.com/prometheus-community/pro-bing v0.3.0
maunium.net/go/mautrix v0.16.1
)
require (
github.com/google/uuid v1.3.1 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/prometheus-community/pro-bing v0.3.0 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/tidwall/gjson v1.16.0 // indirect
github.com/tidwall/match v1.1.1 // indirect

View file

@ -2,6 +2,7 @@ package main
import (
"context"
"embed"
"io/fs"
"log"
"net"
@ -9,8 +10,6 @@ import (
"os"
"time"
"embed"
"git.exozy.me/exozyme/status/core"
"git.exozy.me/exozyme/status/scanner"
"github.com/cbroglie/mustache"
@ -57,7 +56,7 @@ func rootPage(w http.ResponseWriter, r *http.Request) {
// get service status'
timeout := time.Second
ctx, cancel := context.WithTimeout(context.Background(), timeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
data := scanner.TestMultipleServices(ctx, config.Service)
cancel()

View file

@ -1,8 +1,8 @@
package main
import (
"os"
"fmt"
"os"
"strings"
"time"

View file

@ -7,7 +7,7 @@ func CheckHTTP200(ctx Context, url string) (bool, string) {
if err != nil {
return false, err.Error()
}
resp, err := http.DefaultClient.Do(req)
resp, err := http.DefaultClient.Do(req)
if err != nil {
return false, err.Error()
}

View file

@ -70,7 +70,7 @@ func TestService(service ServiceConfig, ctx context.Context) ServiceStatus {
func TestMultipleServices(ctx Context, services []ServiceConfig) []ServiceStatus {
var wg sync.WaitGroup
var data []ServiceStatus = make([]ServiceStatus, len(services))
for i, v := range services {