fixup
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
ab3ad56df7
commit
abfcb0c83e
16
proto.go
16
proto.go
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user