diff options
| author | Jeff Carr <[email protected]> | 2025-02-15 12:16:27 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-15 12:21:34 -0600 |
| commit | 5e837be94b272f6b69b0b68ed070617adcf83ba2 (patch) | |
| tree | 98c485ee2ef2814560da360f0351894cc6f814af /send.go | |
| parent | 46e329f4190bb5b41b1ec5ecf89e319a626f8d63 (diff) | |
move some common things to forgepb
Diffstat (limited to 'send.go')
| -rw-r--r-- | send.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 |
