initial implementation

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-09-03 12:21:00 +03:00
commit 873bad2488
20 changed files with 1827 additions and 0 deletions

36
message.go Normal file
View File

@@ -0,0 +1,36 @@
package tcp
import "github.com/unistack-org/micro/v3/codec"
type tcpMessage struct {
topic string
payload interface{}
contentType string
header map[string]string
body []byte
codec codec.Reader
}
func (r *tcpMessage) Topic() string {
return r.topic
}
func (r *tcpMessage) Payload() interface{} {
return r.payload
}
func (r *tcpMessage) ContentType() string {
return r.contentType
}
func (r *tcpMessage) Header() map[string]string {
return r.header
}
func (r *tcpMessage) Body() []byte {
return r.body
}
func (r *tcpMessage) Codec() codec.Reader {
return r.codec
}