fix for latest micro

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-21 00:02:24 +03:00
parent f56e8756da
commit 73ce52ee15
3 changed files with 6 additions and 40 deletions

View File

@@ -6,7 +6,6 @@ import (
"io/ioutil"
"github.com/ghodss/yaml"
"github.com/unistack-org/micro/v3/codec"
)
@@ -38,11 +37,11 @@ func (c *yamlCodec) Unmarshal(b []byte, v interface{}) error {
return yaml.Unmarshal(b, v)
}
func (c *yamlCodec) ReadHeader(conn io.ReadWriter, m *codec.Message, t codec.MessageType) error {
func (c *yamlCodec) ReadHeader(conn io.Reader, m *codec.Message, t codec.MessageType) error {
return nil
}
func (c *yamlCodec) ReadBody(conn io.ReadWriter, b interface{}) error {
func (c *yamlCodec) ReadBody(conn io.Reader, b interface{}) error {
switch m := b.(type) {
case nil:
return nil
@@ -63,7 +62,7 @@ func (c *yamlCodec) ReadBody(conn io.ReadWriter, b interface{}) error {
return yaml.Unmarshal(buf, b)
}
func (c *yamlCodec) Write(conn io.ReadWriter, m *codec.Message, b interface{}) error {
func (c *yamlCodec) Write(conn io.Writer, m *codec.Message, b interface{}) error {
switch m := b.(type) {
case nil:
return nil