micro-server-tcp/message.go
Vasiliy Tolstov f6c43cbf9e
lint (#53)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2021-04-26 01:10:37 +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
}