Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-11-19 12:57:45 +03:00
parent ab3ad56df7
commit abfcb0c83e

View File

@ -13,22 +13,6 @@ type Codec struct {
Conn io.ReadWriteCloser Conn io.ReadWriteCloser
} }
func (c *Codec) Marshal(v interface{}) ([]byte, error) {
m, ok := v.(proto.Message)
if !ok {
return nil, codec.ErrInvalidMessage
}
return proto.Marshal(m)
}
func (c *Codec) Unmarshal(data []byte, v interface{}) error {
m, ok := v.(proto.Message)
if !ok {
return codec.ErrInvalidMessage
}
return proto.Unmarshal(data, m)
}
func (c *Codec) ReadHeader(m *codec.Message, t codec.MessageType) error { func (c *Codec) ReadHeader(m *codec.Message, t codec.MessageType) error {
return nil return nil
} }