start using a standard http PB
This commit is contained in:
parent
97fe127345
commit
6a99b7b099
16
repo.http.go
16
repo.http.go
|
@ -11,6 +11,22 @@ import (
|
||||||
"go.wit.com/log"
|
"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) {
|
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.
|
// if you ever have "http://www.wit.com//" GO will regect the server recieving it.
|
||||||
// Even though the linux kernel gets the network payload
|
// Even though the linux kernel gets the network payload
|
||||||
|
|
Loading…
Reference in New Issue