add codec.RawMessage support
All checks were successful
test / test (push) Successful in 3m41s
coverage / build (push) Successful in 8m22s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-12-23 21:17:32 +03:00
parent 1ace2631a4
commit 533b265d19
2 changed files with 9 additions and 4 deletions

View File

@@ -1,5 +1,7 @@
package codec
import "gopkg.in/yaml.v3"
// Frame gives us the ability to define raw data to send over the pipes
type Frame struct {
Data []byte
@@ -26,8 +28,9 @@ func (m *Frame) MarshalYAML() ([]byte, error) {
}
// UnmarshalYAML set frame data
func (m *Frame) UnmarshalYAML(data []byte) error {
return m.Unmarshal(data)
func (m *Frame) UnmarshalYAML(n *yaml.Node) error {
m.Data = []byte(n.Value)
return nil
}
// ProtoMessage noop func