micro-server-tcp/message.go
Vasiliy Tolstov 53bd5373d4 lint
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-04-26 01:07:20 +03:00

43 lines
740 B
Go

package tcp
import (
"github.com/unistack-org/micro/v3/codec"
"github.com/unistack-org/micro/v3/metadata"
"github.com/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) Payload() interface{} {
return r.payload
}
func (r *tcpMessage) ContentType() string {
return r.contentType
}
func (r *tcpMessage) Header() metadata.Metadata {
return r.header
}
func (r *tcpMessage) Body() []byte {
return r.body
}
func (r *tcpMessage) Codec() codec.Codec {
return r.codec
}