summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-07 19:14:50 -0500
committerJeff Carr <[email protected]>2025-09-07 21:41:23 -0500
commit6a99b7b099f88edda7e9a4156e3c25750fd4a80e (patch)
tree7cb9a0e1279b939d9fb1b0340d4bd828066282df
parent97fe127345c1362803501d74c10d02d999edde5a (diff)
start using a standard http PBv0.0.119
-rw-r--r--repo.http.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/repo.http.go b/repo.http.go
index 2260d01..d878dc0 100644
--- a/repo.http.go
+++ b/repo.http.go
@@ -11,6 +11,22 @@ import (
"go.wit.com/log"
)
+func (p *Repos) SendReply(w http.ResponseWriter, reqPB *httppb.HttpRequest) error {
+ data, err := p.Marshal()
+ if err != nil {
+ reqPB.Errors = append(reqPB.Errors, log.Sprintf("%v", err))
+ }
+ if len(data) == 0 {
+ reqPB.Errors = append(reqPB.Errors, "Patches PB data was nil/emtpy without Marsha() error")
+ return nil
+ }
+ i, err := w.Write(data)
+ if err != nil {
+ reqPB.Errors = append(reqPB.Errors, log.Sprintf("i=%d %v", i, err))
+ }
+ return err
+}
+
func (p *Repos) HttpPost(baseURL string, route string) (*Repos, error) {
// if you ever have "http://www.wit.com//" GO will regect the server recieving it.
// Even though the linux kernel gets the network payload