summaryrefslogtreecommitdiff
path: root/send.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-15 12:16:27 -0600
committerJeff Carr <[email protected]>2025-02-15 12:21:34 -0600
commit5e837be94b272f6b69b0b68ed070617adcf83ba2 (patch)
tree98c485ee2ef2814560da360f0351894cc6f814af /send.go
parent46e329f4190bb5b41b1ec5ecf89e319a626f8d63 (diff)
move some common things to forgepb
Diffstat (limited to 'send.go')
-rw-r--r--send.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/send.go b/send.go
index 10ca056..e0e7ec5 100644
--- a/send.go
+++ b/send.go
@@ -12,14 +12,14 @@ import (
func pingStatus() error {
var url string
- url = me.urlbase + "/status?hostname=" + me.machine.Hostname
- msg, err := me.machine.Packages.Marshal()
+ url = me.urlbase + "/status?hostname=" + me.forge.Machine.Hostname
+ msg, err := me.forge.Machine.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)
+ body, err := me.forge.HttpPost(url, msg)
if err != nil {
log.Info("httpPost() failed:", err)
return err
@@ -41,12 +41,12 @@ func pingStatus() error {
func sendMachine(s string) error {
var url string
url = me.urlbase + "/machine"
- msg, err := me.machine.Marshal()
+ msg, err := me.forge.Machine.Marshal()
if err != nil {
log.Info("proto.Marshal() failed:", err)
return err
}
- body, err := httpPost(url, msg)
+ body, err := me.forge.HttpPost(url, msg)
if err != nil {
log.Info("httpPost() failed: url", url)
log.Info("httpPost() failed:", err)
@@ -69,7 +69,7 @@ func sendMachine(s string) error {
os.Exit(0)
} else {
log.Info(me.urlbase, "is maybe not working GOT:", line)
- log.Info(me.urlbase, "fail count", me.failcount, "from hostname", me.machine.Hostname)
+ log.Info(me.urlbase, "fail count", me.failcount, "from hostname", me.forge.Machine.Hostname)
}
}
return nil