summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-08 04:03:43 -0500
committerJeff Carr <[email protected]>2025-09-08 04:03:43 -0500
commit1745f44aa08b46963ede4368b15894b16b52e207 (patch)
treed67a5865125bacdb452cd1d6e70987f5392a2075
parentf9c8a37491c06825db17faa8d11e7413c342b40b (diff)
file is autogen'd nowv0.0.120
-rw-r--r--repo.http.go68
1 files changed, 0 insertions, 68 deletions
diff --git a/repo.http.go b/repo.http.go
deleted file mode 100644
index 794ee43..0000000
--- a/repo.http.go
+++ /dev/null
@@ -1,68 +0,0 @@
-package gitpb
-
-import (
- "net/http"
-
- "go.wit.com/lib/protobuf/httppb"
- "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
-}
-
-/*
-// err handling here isn't great
-func (p *Repos) HttpPost(baseURL string, route string) (*Repos, *httppb.HttpRequest, 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
- // also it never gives you an error about that, it just goes away invisably inside GO
- tmpURL, _ := url.Parse(baseURL) // "http://forge.grid.wit.com:2520")
- finalURL := tmpURL.JoinPath("/repos/", route)
-
- data, _ := p.Marshal()
-
- var err error
- var req *http.Request
-
- log.Info("reposs PB HttpPost", finalURL.String())
- req, err = http.NewRequest(http.MethodPost, finalURL.String(), bytes.NewBuffer(data))
- if req == nil {
- return nil, nil, err
- }
-
- usr, _ := user.Current()
- req.Header.Set("author", usr.Username)
- hostname, _ := os.Hostname()
- req.Header.Set("hostname", hostname)
-
- newdata, err := httppb.PostReq(req)
-
- reqPB, err2 := httppb.ReqToPB(req)
- reqPB.URL = finalURL.String()
- if err != nil {
- reqPB.Errors = append(reqPB.Errors, fmt.Sprintf("%v", err))
- }
- if err2 != nil {
- reqPB.Errors = append(reqPB.Errors, fmt.Sprintf("%v", err2))
- }
-
- newpb := NewRepos()
- err = newpb.Unmarshal(newdata)
-
- log.Infof("repos PB HttpPost %s sent len(%d) got len(%d)\n", finalURL.String(), p.Len(), newpb.Len())
- return newpb, reqPB, err
-}
-*/