summaryrefslogtreecommitdiff
path: root/vendor/github.com/gin-gonic/gin/binding/protobuf.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2022-04-26 20:30:25 -0700
committerLibravatar Terin Stock <terinjokes@gmail.com>2023-01-31 15:16:42 +0100
commit83b4c9ebc87d0fddf4e638f13e3af1483912e3a5 (patch)
tree47840b84c0fd3cb226eab2ecb3dbce0617163406 /vendor/github.com/gin-gonic/gin/binding/protobuf.go
parent[chore] update URLs to forked source (diff)
downloadgotosocial-83b4c9ebc87d0fddf4e638f13e3af1483912e3a5.tar.xz
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/gin-gonic/gin/binding/protobuf.go')
-rw-r--r--vendor/github.com/gin-gonic/gin/binding/protobuf.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/github.com/gin-gonic/gin/binding/protobuf.go b/vendor/github.com/gin-gonic/gin/binding/protobuf.go
deleted file mode 100644
index f9ece928d..000000000
--- a/vendor/github.com/gin-gonic/gin/binding/protobuf.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
-// Use of this source code is governed by a MIT style
-// license that can be found in the LICENSE file.
-
-package binding
-
-import (
- "io/ioutil"
- "net/http"
-
- "github.com/golang/protobuf/proto"
-)
-
-type protobufBinding struct{}
-
-func (protobufBinding) Name() string {
- return "protobuf"
-}
-
-func (b protobufBinding) Bind(req *http.Request, obj interface{}) error {
- buf, err := ioutil.ReadAll(req.Body)
- if err != nil {
- return err
- }
- return b.BindBody(buf, obj)
-}
-
-func (protobufBinding) BindBody(body []byte, obj interface{}) error {
- if err := proto.Unmarshal(body, obj.(proto.Message)); err != nil {
- return err
- }
- // Here it's same to return validate(obj), but util now we can't add
- // `binding:""` to the struct which automatically generate by gen-proto
- return nil
- // return validate(obj)
-}