2020-09-03 12:21:00 +03:00
|
|
|
package tcp
|
|
|
|
|
2020-11-18 13:02:53 +03:00
|
|
|
import (
|
|
|
|
"github.com/unistack-org/micro/v3/codec"
|
|
|
|
"github.com/unistack-org/micro/v3/metadata"
|
|
|
|
)
|
2020-09-03 12:21:00 +03:00
|
|
|
|
|
|
|
type tcpMessage struct {
|
|
|
|
topic string
|
|
|
|
payload interface{}
|
|
|
|
contentType string
|
2020-11-18 13:02:53 +03:00
|
|
|
header metadata.Metadata
|
2020-09-03 12:21:00 +03:00
|
|
|
body []byte
|
2020-11-25 23:56:38 +03:00
|
|
|
codec codec.Codec
|
2020-09-03 12:21:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpMessage) Topic() string {
|
|
|
|
return r.topic
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpMessage) Payload() interface{} {
|
|
|
|
return r.payload
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpMessage) ContentType() string {
|
|
|
|
return r.contentType
|
|
|
|
}
|
|
|
|
|
2020-11-18 13:02:53 +03:00
|
|
|
func (r *tcpMessage) Header() metadata.Metadata {
|
2020-09-03 12:21:00 +03:00
|
|
|
return r.header
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *tcpMessage) Body() []byte {
|
|
|
|
return r.body
|
|
|
|
}
|
|
|
|
|
2020-11-25 23:56:38 +03:00
|
|
|
func (r *tcpMessage) Codec() codec.Codec {
|
2020-09-03 12:21:00 +03:00
|
|
|
return r.codec
|
|
|
|
}
|