add codec NewMessage helper

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-11-24 15:14:47 +03:00
parent c9049c3845
commit 71d82e9d5b

View File

@ -54,3 +54,7 @@ type Message struct {
Header metadata.Metadata Header metadata.Metadata
Body []byte Body []byte
} }
func NewMessage(t MessageType) *Message {
return &Message{Type: t, Header: metadata.New(0)}
}