2024-11-15 19:25:24 -06:00
|
|
|
// Copyright 2024 WIT.COM Inc Licensed GPL 3.0
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"go.wit.com/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
var urlbase string = "http://localhost:8080"
|
|
|
|
|
|
|
|
func send() {
|
|
|
|
}
|
|
|
|
|
|
|
|
func pingStatus() error {
|
|
|
|
var url string
|
2024-11-15 19:52:46 -06:00
|
|
|
url = urlbase + "/status?hostname=stuff"
|
|
|
|
msg, err := me.packages.Marshal()
|
|
|
|
if err != nil {
|
|
|
|
log.Info("proto.Marshal() failed:", err)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
log.Info("proto Marshal len =", len(msg))
|
|
|
|
body, err := httpPost(url, msg)
|
2024-11-15 19:25:24 -06:00
|
|
|
if err != nil {
|
|
|
|
log.Info("httpPost() failed:", err)
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
test := strings.TrimSpace(string(body))
|
|
|
|
// log.Info("virtigo returned body:", test)
|
|
|
|
for _, line := range strings.Split(test, "\n") {
|
|
|
|
log.Info("GOT:", line)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|