diff options
| author | Jeff Carr <[email protected]> | 2024-10-29 09:02:15 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-29 09:02:15 -0500 |
| commit | 9d08114b9339e9be06c11040432790682e389de3 (patch) | |
| tree | ca6c98c11e9e87a4763cc68a1cb5aa7ed39c8da7 | |
| parent | 8724a07b0d7cf3a3071f1192481ee33c0bfeeee0 (diff) | |
code reorg
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | http.go | 51 |
1 files changed, 13 insertions, 38 deletions
@@ -6,7 +6,6 @@ import ( "os" "strings" - pb "go.wit.com/lib/protobuf/virtbuf" "go.wit.com/lib/virtigoxml" "go.wit.com/log" ) @@ -21,43 +20,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) { var route string route = cleanURL(r.URL.Path) - // show only what droplets should be running but are missing - if route == "/missing" { - var count int - var missing int - for _, d := range me.cluster.Droplets { - if d.StartState != pb.DropletState_ON { - continue - } - count += 1 - if d.CurrentState == pb.DropletState_ON { - continue - } - missing += 1 - fmt.Fprintln(w, d.Hostname, "current state:", d.CurrentState) - } - if missing == 0 { - fmt.Fprintln(w, "all", count, "droplets set to run are running") - } else { - fmt.Fprintln(w, missing, "droplets missing") - fmt.Fprintln(w, count, "droplets should be running") - } - return - } - - if route == "/favicon.ico" { - // w.Header().Set("Content-Type", "image/svg+xml") - w.Header().Set("Content-Type", "image/png") - writeFile(w, "ipv6.png") - return - } - - if route == "/goReference.svg" { - w.Header().Set("Content-Type", "image/svg+xml") - writeFile(w, "goReference.svg") - return - } - if route == "/uptime" { ok, s := uptimeCheck() if ok { @@ -143,6 +105,19 @@ func okHandler(w http.ResponseWriter, r *http.Request) { return } + if route == "/favicon.ico" { + // w.Header().Set("Content-Type", "image/svg+xml") + w.Header().Set("Content-Type", "image/png") + writeFile(w, "ipv6.png") + return + } + + if route == "/goReference.svg" { + w.Header().Set("Content-Type", "image/svg+xml") + writeFile(w, "goReference.svg") + return + } + log.Warn("BAD URL =", route) fmt.Fprintln(w, "BAD URL tmp =", route) } |
