diff options
| author | Jeff Carr <[email protected]> | 2025-09-07 19:14:50 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-07 21:41:23 -0500 |
| commit | 6a99b7b099f88edda7e9a4156e3c25750fd4a80e (patch) | |
| tree | 7cb9a0e1279b939d9fb1b0340d4bd828066282df /repo.http.go | |
| parent | 97fe127345c1362803501d74c10d02d999edde5a (diff) | |
start using a standard http PBv0.0.119
Diffstat (limited to 'repo.http.go')
| -rw-r--r-- | repo.http.go | 16 |
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 |
