summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-09 19:15:31 -0500
committerJeff Carr <[email protected]>2025-09-09 19:15:31 -0500
commitd656828a0f210561020a7ae742041d19cc44b624 (patch)
tree02099a972ef38c6960e353d27450df4fba27f80f
parent1c479b61f6b92829d30340198e2476191cdc168e (diff)
used this to fix autogenpb 'http' functionsv0.0.62v0.0.61v0.0.60
-rw-r--r--http.go16
-rw-r--r--machine.proto4
2 files changed, 9 insertions, 11 deletions
diff --git a/http.go b/http.go
index fae1ff7..f2a470c 100644
--- a/http.go
+++ b/http.go
@@ -37,10 +37,10 @@ func (m *Machine) HttpPostMachine(url string) ([]byte, error) {
log.Info("WTF. check == nil")
}
// log.Info("good? check.hostname =", m.Hostname)
- return m.HttpPost(url, msg)
+ return m.HttpPostOld(url, msg)
}
-func (m *Machine) HttpPost(url string, data []byte) ([]byte, error) {
+func (m *Machine) HttpPostOld(url string, data []byte) ([]byte, error) {
var err error
var req *http.Request
@@ -49,13 +49,11 @@ func (m *Machine) HttpPost(url string, data []byte) ([]byte, error) {
usr, _ := user.Current()
req.Header.Set("author", usr.Username)
- /*
- if f.Machine == nil {
- // run f.InitMachine() here?
- log.Info("you must run f.InitMachine()")
- return nil, fmt.Errorf("you must run f.InitMachine()")
- }
- */
+ // if f.Machine == nil {
+ // // run f.InitMachine() here?
+ // log.Info("you must run f.InitMachine()")
+ // return nil, fmt.Errorf("you must run f.InitMachine()")
+ // }
req.Header.Set("hostname", m.Hostname)
client := &http.Client{}
diff --git a/machine.proto b/machine.proto
index c0f6c48..9cca303 100644
--- a/machine.proto
+++ b/machine.proto
@@ -7,7 +7,7 @@ import "google/protobuf/timestamp.proto"; // Import the well-known type for Time
// global settings for autogenpb `autogenpb:mutex`
-message Machine { // `autogenpb:marshal`
+message Machine { // `autogenpb:marshal` `autogenpb:http`
string hostname = 1; // `autogenpb:unique` `autogenpb:sort`
int64 memory = 2;
int64 cpus = 3;
@@ -23,7 +23,7 @@ message Machine { // `autogenpb:marshal`
string upgradeCmd = 13; // upgrade cmd
}
-message Machines { // `autogenpb:marshal` `autogenpb:gui`
+message Machines { // `autogenpb:marshal` `autogenpb:gui` `autogenpb:http`
string uuid = 1; // `autogenpb:uuid:b57e7fac-a8fc-4949-9d50-fa38312dec87`
string version = 2; // `autogenpb:version:v0.0.1`
repeated Machine machines = 3;