micro-server-tcp/message.go
Vasiliy Tolstov 7e512979c8 server: remove unparsed body from request and message
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2022-03-21 15:30:19 +03:00

39 lines
658 B
Go

package tcp
import (
"go.unistack.org/micro/v3/codec"
"go.unistack.org/micro/v3/metadata"
"go.unistack.org/micro/v3/server"
)
var _ server.Message = &tcpMessage{}
type tcpMessage struct {
payload interface{}
codec codec.Codec
header metadata.Metadata
topic string
contentType string
body []byte
}
func (r *tcpMessage) Topic() string {
return r.topic
}
func (r *tcpMessage) ContentType() string {
return r.contentType
}
func (r *tcpMessage) Header() metadata.Metadata {
return r.header
}
func (r *tcpMessage) Body() interface{} {
return r.payload
}
func (r *tcpMessage) Codec() codec.Codec {
return r.codec
}