Merge branch 'master' into registry-namespace

This commit is contained in:
ben-toogood 2020-04-14 16:03:29 +01:00 committed by GitHub
commit 67e7aa223a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

28
codec/proto/message.go Normal file
View File

@ -0,0 +1,28 @@
package proto
type Message struct {
Data []byte
}
func (m *Message) ProtoMessage() {}
func (m *Message) Reset() {
*m = Message{}
}
func (m *Message) String() string {
return string(m.Data)
}
func (m *Message) Marshal() ([]byte, error) {
return m.Data, nil
}
func (m *Message) Unmarshal(data []byte) error {
m.Data = data
return nil
}
func NewMessage(data []byte) *Message {
return &Message{data}
}