diff options
| author | Jeff Carr <[email protected]> | 2025-09-06 18:43:23 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-06 18:48:53 -0500 |
| commit | 4e5a34b772db9df404b0b927f3ee9b9b54f65cdd (patch) | |
| tree | d8d1c28655f972aa5b72823d7571bcce68d07815 /handlePatches.go | |
| parent | f8b2ff5acedc1835cee10acca49649d1957ed781 (diff) | |
convert http req directly to PB
Diffstat (limited to 'handlePatches.go')
| -rw-r--r-- | handlePatches.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/handlePatches.go b/handlePatches.go index 3a0317c..f270d74 100644 --- a/handlePatches.go +++ b/handlePatches.go @@ -5,6 +5,7 @@ import ( "strings" "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/lib/protobuf/httppb" "go.wit.com/log" ) @@ -33,6 +34,12 @@ func handlePatches(w http.ResponseWriter, r *http.Request, data []byte) error { return nil } +func makePatchesPB(reqPB *httppb.HttpRequest) (*forgepb.Patches, error) { + pb := forgepb.NewPatches() + err := pb.Unmarshal(reqPB.Body) + return pb, err +} + func sendPatchesError(w http.ResponseWriter, r *forgepb.Patches, err error) error { log.Info("send error back to user", err) return nil |
