Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-03-07 22:38:30 +03:00
parent 710b97bbb7
commit bcf7b8bb5c
3 changed files with 0 additions and 18 deletions

1
go.mod
View File

@ -4,7 +4,6 @@ go 1.15
require ( require (
github.com/golang/protobuf v1.4.3 github.com/golang/protobuf v1.4.3
github.com/unistack-org/micro-proto v0.0.2-0.20210307161332-120b8d428313
github.com/unistack-org/micro/v3 v3.2.20 github.com/unistack-org/micro/v3 v3.2.20
google.golang.org/protobuf v1.25.0 google.golang.org/protobuf v1.25.0
) )

2
go.sum
View File

@ -29,8 +29,6 @@ github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I= github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
github.com/unistack-org/micro-proto v0.0.2-0.20210307161332-120b8d428313 h1:6BWhJJPVlsvkll5GLtxyQgvyZJDnYLEn2FuSoNmtZ4A=
github.com/unistack-org/micro-proto v0.0.2-0.20210307161332-120b8d428313/go.mod h1:GYO53DWmeldRIo90cAdQx8bLr/WJMxW62W4ja74p1Ac=
github.com/unistack-org/micro/v3 v3.2.20 h1:EY94FDfHR43QvKNjmCaVH8/7+D8bmLwySXbFK9iIQY0= github.com/unistack-org/micro/v3 v3.2.20 h1:EY94FDfHR43QvKNjmCaVH8/7+D8bmLwySXbFK9iIQY0=
github.com/unistack-org/micro/v3 v3.2.20/go.mod h1:y+fV+BPNK2IqGoLquRU396jTYifG0HCw3zxFfI4E0dc= github.com/unistack-org/micro/v3 v3.2.20/go.mod h1:y+fV+BPNK2IqGoLquRU396jTYifG0HCw3zxFfI4E0dc=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

View File

@ -7,7 +7,6 @@ import (
// nolint: staticcheck // nolint: staticcheck
oldproto "github.com/golang/protobuf/proto" oldproto "github.com/golang/protobuf/proto"
mproto "github.com/unistack-org/micro-proto/proto"
"github.com/unistack-org/micro/v3/codec" "github.com/unistack-org/micro/v3/codec"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -18,8 +17,6 @@ func (c *protoCodec) Marshal(v interface{}) ([]byte, error) {
switch m := v.(type) { switch m := v.(type) {
case nil: case nil:
return nil, nil return nil, nil
case *mproto.Frame:
return m.Data, nil
case *codec.Frame: case *codec.Frame:
return m.Data, nil return m.Data, nil
case proto.Message: case proto.Message:
@ -37,8 +34,6 @@ func (c *protoCodec) Unmarshal(d []byte, v interface{}) error {
switch m := v.(type) { switch m := v.(type) {
case nil: case nil:
return nil return nil
case *mproto.Frame:
m.Data = d
case *codec.Frame: case *codec.Frame:
m.Data = d m.Data = d
case proto.Message: case proto.Message:
@ -57,13 +52,6 @@ func (c *protoCodec) ReadBody(conn io.Reader, b interface{}) error {
switch m := b.(type) { switch m := b.(type) {
case nil: case nil:
return nil return nil
case *mproto.Frame:
buf, err := ioutil.ReadAll(conn)
if err != nil {
return err
}
m.Data = buf
return nil
case *codec.Frame: case *codec.Frame:
buf, err := ioutil.ReadAll(conn) buf, err := ioutil.ReadAll(conn)
if err != nil { if err != nil {
@ -91,9 +79,6 @@ func (c *protoCodec) Write(conn io.Writer, m *codec.Message, b interface{}) erro
switch m := b.(type) { switch m := b.(type) {
case nil: case nil:
return nil return nil
case *mproto.Frame:
_, err := conn.Write(m.Data)
return err
case *codec.Frame: case *codec.Frame:
_, err := conn.Write(m.Data) _, err := conn.Write(m.Data)
return err return err