SendPB()
This commit is contained in:
parent
e2ca78cfb3
commit
33399f18e5
13
http.go
13
http.go
|
@ -4,6 +4,7 @@ package gitpb
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os/user"
|
||||
|
@ -59,3 +60,15 @@ func (r *Repos) SubmitReposPB(url string) (*Repos, error) {
|
|||
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (r *Repos) SendPB(w http.ResponseWriter) error {
|
||||
data, err := r.Marshal()
|
||||
if err != nil {
|
||||
log.Info("Marshal() failed:", err)
|
||||
return err
|
||||
}
|
||||
log.Info("SendPB() Marshal() len(data)", len(data))
|
||||
fmt.Fprintf(w, "%s", data)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue