2021-03-11 07:42:42 +03:00
|
|
|
package codec
|
|
|
|
|
|
|
|
// Frame gives us the ability to define raw data to send over the pipes
|
|
|
|
type Frame struct {
|
|
|
|
Data []byte
|
|
|
|
}
|
2021-09-22 16:59:52 +03:00
|
|
|
|
|
|
|
func (m *Frame) MarshalJSON() ([]byte, error) {
|
|
|
|
return m.Data, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Frame) UnmarshalJSON(data []byte) error {
|
|
|
|
m.Data = data
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Frame) ProtoMessage() {}
|
|
|
|
|
|
|
|
func (m *Frame) Reset() {
|
|
|
|
*m = Frame{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Frame) String() string {
|
|
|
|
return string(m.Data)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Frame) Marshal() ([]byte, error) {
|
|
|
|
return m.Data, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Frame) Unmarshal(data []byte) error {
|
|
|
|
m.Data = data
|
|
|
|
return nil
|
|
|
|
}
|