add Frame support in noop codec

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-11-25 09:59:28 +03:00
parent 8a50a2d0b8
commit 2101e994d9

View File

@ -74,6 +74,8 @@ func (n *noopCodec) Marshal(v interface{}) ([]byte, error) {
return *ve, nil return *ve, nil
case []byte: case []byte:
return ve, nil return ve, nil
case *Frame:
return ve.Data, nil
case *Message: case *Message:
return ve.Body, nil return ve.Body, nil
} }
@ -86,6 +88,8 @@ func (n *noopCodec) Unmarshal(d []byte, v interface{}) error {
ve = d ve = d
case *[]byte: case *[]byte:
*ve = d *ve = d
case *Frame:
ve.Data = d
case *Message: case *Message:
ve.Body = d ve.Body = d
} }